Loading scenes only if necessary.

parent 6e920ec3
......@@ -18,12 +18,12 @@ public class SceneController : MonoBehaviour
public void Start()
{
if (SceneManager.sceneCount == 1)
if (!SceneManager.GetSceneByName(contextScene).isLoaded)
{
SceneManager.sceneLoaded += SimpleSceneLoaded;
SceneManager.LoadSceneAsync(contextScene, LoadSceneMode.Additive);
}
if (!Application.isEditor)
if (!Application.isEditor && !SceneManager.GetSceneByName("UI").isLoaded)
{
SceneManager.LoadSceneAsync("UI", LoadSceneMode.Additive);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment