When I start my app, I get a temporary 8 seconds black screen right after the splash screen, and after that my heavy scene is loaded. To solve this and after reading other questions- I added an empty Scene0 in order to load the heavy scene in the background. But it didn’t solve the problem- I tried 2 solutions:
public class Scene0 : MonoBehaviour
{
public string levelName;
AsyncOperation async;
void Start() {
StartCoroutine("load");
}
IEnumerator load() {
async = SceneManager.LoadSceneAsync(heavyScene);
async.allowSceneActivation = false;
yield return async;
}
public void ActivateScene() { //Button
async.allowSceneActivation = true;
}
Result: 4 seconds black screen after the splash screen + 4 seconds black after clicking the button (scene was supposed to be loaded so not sure why black)
- Removed void Start() function. And changed the button function to-
public void ActivateScene() {
StartCoroutine("load");
async.allowSceneActivation = true;
}
Result: No black screen after the splash screen (yay). But 8 seconds black screen after clicking the button