public void LoadCity(int cityIndex) { if (cityIndex == ActiveCity.Value) { Debug.Log("Close Window, because this is Active City"); } else { CoreSceneController.SwitchScene(cityIndex); } }
protected void OnDestroy() { //Clean Up all updateDelegates if (updateDelegates != null) { for (int i = 0; i < (int)SceneState.Count; i++) { updateDelegates[i] = null; } updateDelegates = null; } //Clean Up the singleton instance if (coreSceneController != null) { coreSceneController = null; } }
protected void Awake() { Object.DontDestroyOnLoad(gameObject); coreSceneController = this; updateDelegates = new UpdateDelegate[(int)SceneState.Count]; //Set each updateDelegate updateDelegates[(int)SceneState.Reset] = UpdateSceneReset; updateDelegates[(int)SceneState.Preload] = UpdateScenePreload; updateDelegates[(int)SceneState.Load] = UpdateSceneLoad; updateDelegates[(int)SceneState.Unload] = UpdateSceneUnload; updateDelegates[(int)SceneState.PostLoad] = UpdateScenePostLoad; updateDelegates[(int)SceneState.Ready] = UpdateSceneReady; updateDelegates[(int)SceneState.Run] = UpdateSceneRun; nextSceneId = ActiveScene.Value; sceneState = SceneState.Reset; //gameObject.GetComponent<Camera>().orthographicSize = Screen.height / 2; }