void Awake() { Instance = this; DontDestroyOnLoad(this); //Will actually be destroyed when the main game scene is loaded again, but unfortunately this //object is created before the game scene loads, so we need to do this to prevent the game scene //load from destroying it standardLevelGameplayManager = Resources.FindObjectsOfTypeAll <StandardLevelGameplayManager>().First(); StartCoroutine(DoOnLevelStart()); }
void OnDestroy() => Instance = null;