Search Unity

Preloading a scene in awake.

Discussion in 'Scripting' started by LazyOnion, Feb 8, 2019.

  1. LazyOnion

    LazyOnion

    Joined:
    Mar 6, 2018
    Posts:
    15
    I stumbled onto something weird I think, when I run the loadsceneasync in awake but I halt the activation, the scene just loads.Is this intended or am I misusing the scenemanager?|

    Code (CSharp):
    1. private void Awake()
    2.         {
    3.              async_op = SceneManager.LoadSceneAsync(GameScene[nextState],LoadSceneMode.Single);
    4.             async_op.allowSceneActivation = false;
    5.             SceneManager.sceneLoaded += OnSceneLoaded;
    6.         }
     
  2. hjohnsen

    hjohnsen

    Joined:
    Feb 4, 2018
    Posts:
    35
    There is no async loading in the editor.