private void Awake() { //Singleton pattern if (Instance == null) { Instance = this; SceneManager.sceneLoaded += OnSceneLoaded; DontDestroyOnLoad(this.gameObject); } else if (Instance != this) { Destroy(gameObject); return; } if (firstTime && SceneManager.GetActiveScene().buildIndex == 0) { gameConfiguration.RestartToDefault(); //Restart game configuration to default in case data cannot be retrieved (this is only needed in editor as it's a SO). dataRetriever.AddFinishDataListener(LoadFirstScene); //Load first scene when data is finished retrieving (or fails to retrieve) dataRetriever.RetrieveData(); //Retrive data } }