어드레서블 다운로드 실시간 적용

This commit is contained in:
Ino 2025-03-04 13:49:39 +09:00
parent 815a9e7edd
commit dbc0fcfa6c
4 changed files with 26 additions and 9 deletions

View File

@ -461,6 +461,23 @@ public static class MyEditorUtil
EditorApplication.update += UpdateAllObjects; EditorApplication.update += UpdateAllObjects;
} }
[MenuItem("Tools/Del_AddrResource")]
static void Del_AddrResource()
{
bool result = EditorUtility.DisplayDialog(
"경고!", // 제목
"모든 어드레서블 데이터를 삭제하시겠습니까?", // 메시지
"확인", // 확인 버튼
"취소" // 취소 버튼
);
if (result)
{
Caching.ClearCache();
EditorUtility.DisplayDialog("알림", "삭제 완료", "확인");
}
}
//[MenuItem("Edit/Find All Particle", false, -103)] //[MenuItem("Edit/Find All Particle", false, -103)]
//public static void FindAllParticle() //public static void FindAllParticle()
//{ //{

View File

@ -64,7 +64,6 @@ messageinfo 엄청 느린 버그
- 몬스터 패트롤 거리 조절 - 몬스터 패트롤 거리 조절
- 점수와 골드 (기본 1점, 10골드만 주는 중(밸런스 필요)) - 점수와 골드 (기본 1점, 10골드만 주는 중(밸런스 필요))
어드레서블 다운로드 눈속임 타겟 락 시 카메라 타겟에게 고정
5그룹이라면 0~1 갈 때 0.2까지 쭉 올리고, 1~2 갈 때 0.4까지 쭉 올리고... 1까지 올리면 되지 않을까? 100%에서 다 되면 넘어가면 되지 로딩 UI

View File

@ -36,14 +36,12 @@ public class MainToTitle : MonoBehaviour
{ {
label_slider.text = ""; label_slider.text = "";
long totalDownloadSize = 0; long totalDownloadSize = 0;
long currentDownloadedSize = 0; // 현재까지 다운로드된 용량 int totalLabels = 0;
int totalLabels = addr_Labels.Count; long currentDownloadedSize = 0; // 현재까지 다운로드한 용량
var labels = new List<string>(); var labels = new List<string>();
foreach (var labelRef in addr_Labels) foreach (var labelRef in addr_Labels)
{
labels.Add(labelRef.labelString); labels.Add(labelRef.labelString);
}
// 다운로드 크기 계산 (실패 시 재시도) // 다운로드 크기 계산 (실패 시 재시도)
bool calcSuccess = false; bool calcSuccess = false;
@ -59,6 +57,7 @@ public class MainToTitle : MonoBehaviour
if (handle.Status == AsyncOperationStatus.Succeeded) if (handle.Status == AsyncOperationStatus.Succeeded)
{ {
totalDownloadSize += handle.Result; totalDownloadSize += handle.Result;
++totalLabels;
} }
else else
{ {
@ -107,7 +106,10 @@ public class MainToTitle : MonoBehaviour
while (!downHandle.IsDone) while (!downHandle.IsDone)
{ {
float progress = (float)currentDownloadedSize / totalDownloadSize; // 현재 파일의 다운로드 진행률 반영
float labelProgress = downHandle.PercentComplete * handle.Result;
float progress = (currentDownloadedSize + labelProgress) / totalDownloadSize;
slider_download.value = progress; slider_download.value = progress;
label_slider.text = $"{progress * 100f:N2}%"; label_slider.text = $"{progress * 100f:N2}%";
yield return null; yield return null;
@ -115,7 +117,6 @@ public class MainToTitle : MonoBehaviour
if (downHandle.Status == AsyncOperationStatus.Succeeded) if (downHandle.Status == AsyncOperationStatus.Succeeded)
{ {
// 다운로드 완료 후 currentDownloadedSize에 추가
currentDownloadedSize += handle.Result; currentDownloadedSize += handle.Result;
} }
else else