๊ตฌ๊ธ€์—์„œ ์ฐพ์€ ๋กœ๋”ฉํ™”๋ฉดย ์˜ˆ์ œ ๋œฏ์–ด๋ณด๊ณ  ์ง์ ‘ ๋งŒ๋“ค์–ด๋ณด๋Š”๋ฐ ์ž๊พธ ๋ฒ„๊ทธ๊ฐ€ ํ•ด๊ฒฐ์ด ์•ˆ๋œ๋‹ค ใ… ใ… 


IEnumerator LoadScene()

{

AsyncOperation asyncLoading = SceneManager.LoadSceneAsync(SceneName);

asyncLoading.allowSceneActivation = false;

Debug.Log(SceneName + "ํŽ„์Šค");


while (!asyncLoading.isDone)

{

yield return null;


if (asyncLoading.progress < 0.9f)

{

ProgressPercent = asyncLoading.progress;

Debug.Log("< 0.9 ์ถœ๋ ฅ๋˜๋Š” ํผ์„ผํŠธ๊ฐ’" + ProgressPercent);

}

else

{

Timer += Time.unscaledDeltaTime;

ProgressPercent = Mathf.Lerp(0.9f, 1f, Timer/5);

Debug.Log(Timer + "time ๊ฐ’");

if (ProgressPercent >=1f)

{

asyncLoading.allowSceneActivation = true;

yield break;

}

}


string ProgressPercentText = Mathf.Floor((ProgressPercent * 100)).ToString();

Progress.text = ProgressPercentText + "%";

Debug.Log(ProgressPercent + "์ถœ๋ ฅ๋˜๋Š” ํผ์„ผํŠธ ๊ฐ’");


}

}


๊ทธ๋ฆฌ๊ณ  ๋Œ€๊ฐ• ์ด๋Ÿฐ์‹์ด๊ณ  90ํผ ์ดํ•˜ ๋กœ๋”ฉ๋˜๋Š” ๋ถ€๋ถ„์—์„œ ๋กœ๋”ฉ๋ฐ” ํผ์„ผํŠธ๊ฐ€ ์•ˆ์˜ฌ๋ผ๊ฐ