void Awake(){ levelSelectSaveLoad = this; if (File.Exists(Application.persistentDataPath + levelStateDataFileEndAddress) == false && SceneManager.GetActiveScene().buildIndex == LEVEL_SELECT_SCENE_INDEX) { // Using using closes the file once it has been created using (File.Create(Application.persistentDataPath + levelStateDataFileEndAddress)){} GameControler.GetDefaultLevelCompleteArray(); } Load(); }
// Called when a new scene is loaded void OnLevelWasLoaded(){ levelSelectSaveLoad = this; }