I want to create a options scene that can be accessed by the main menu and the ingame menu.
public void LoadOptions()
{
SceneManager.LoadScene("Options", LoadSceneMode.Additive);
}
Some problems appear:
The other scene is still visible
Do I have to create a panel that hides the other scene? (Black background for example)
Is it possible to disable the other scene until the options scene gets destroyed?
I can’t destroy the options scene on “Back” button
public void Back()
{
SceneManager.UnloadSceneAsync("Options");
}
It doesn’t get destroyed, so how do I get back to the game?
Yes, the point of multiple scenes is to allow them all to be visible at the same time, if they don’t conflict in some other way. You would have to (1) black out your canvas background, and (2) set some mode that all your game classes would honor, to freeze the action while you’re in your options menu. One common approach is to set Time.timeScale to 0, effectively freezing time and preventing unexpected Update() or FixedUpdate() motion. Any animation in your Options dialog would need to work with unscaled time.
I am not sure, but I think an object which is NOT going away (in the main game scene for example) will have to be the one to call SceneManager.UnloadSceneAsync(). The Async job might be killed off when the object that called it is destroyed, which may be before the Async job got everything else done.