Below is the code I’m using on my EULA screen to preload my game. I want to wait until the user clicks the accept button on the EULA before switching to the game scene. What’s weird is if I start the LoadYourAsyncScene coroutine in the Awake function it will ignore the allowSceneActivation = false and it will switch scenes as soon as it is finished loading. However if I use a coroutine to wait a second or two before beginning the LoadYourAsyncScene it will work like I expect and wait until the accept button is pressed. Am I doing something wrong here or is this a bug?
IEnumerator LoadYourAsyncScene()
{
asyncLoad = SceneManager.LoadSceneAsync(scene);
asyncLoad.allowSceneActivation = false;
// Wait until the asynchronous scene fully loads
while (!asyncLoad.isDone)
{
// scene has loaded as much as possible, the last 10% can't be multi-threaded
if (changeSceneNow)
{
asyncLoad.allowSceneActivation = true;
}
yield return null;
}
}
public void ChangeSceneNow()
{
changeSceneNow = true;
}
you have to wait that long?
i have the same problem, zero feedback from unity which indicates that nobody there knows, or that those who know are pushing yet another way of doing this very simple task