Hello,
I have a pretty simple loading bar currently in a main menu scene.
IEnumerator LoadingScreen(string sceneName)
{
loadingScreenObj.SetActive(true);
aSync = SceneManager.LoadSceneAsync(sceneName);
aSync.allowSceneActivation = false;
while (!aSync.isDone)
{
loadSlider.value = aSync.progress;
if(aSync.progress == 0.9f)
{
loadSlider.value = 1f;
aSync.allowSceneActivation = true;
}
yield return null;
}
}
This is all fine and dandy, and works well enough (I followed a tutorial to get the effect). The problem is that the game scene that it loads into has an Awake() function that takes about 20 seconds to get through because it generates land and initializes a lot of scripts.
After a bit of research, I’m still confused. How do I get it so that the loading bar in the main menu includes this awake function in the game scene? Can I make it so that Text in the UI of the main menu scene changes based on the part of the super long awake function?
Is any of this even possible?