Search Unity

Load custom scene BEFORE inspector scene is loaded?

Discussion in 'Scripting' started by FeastSC2, Feb 13, 2020.

  1. FeastSC2

    FeastSC2

    Joined:
    Sep 30, 2016
    Posts:
    978
    I have a scene with all my Game Systems. These are systems I want to have active throughout the game.

    What I want is specifically this: I would like it that when I enter playmode, the scene with the GameSystems is loaded BEFORE the hierarchy scene.

    Is that possible?
     
    Last edited: Feb 13, 2020
  2. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    38,745
    Yes but scene loading requires one frame. You can make a singleton pattern that requires any singleton in your game to load a scene additively. But like I said you can't use it until next frame, so the singleton instance returned would possibly not yet be valid.

    You can also make an editor script to always jump to your "zeroscene" first when you hit play. There's plenty of such handy scripts out there to look at.