示例#1
0
 public void LoadCity(int cityIndex)
 {
     if (cityIndex == ActiveCity.Value)
     {
         Debug.Log("Close Window, because this is Active City");
     }
     else
     {
         CoreSceneController.SwitchScene(cityIndex);
     }
 }
示例#2
0
    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;
        }
    }
示例#3
0
    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;
    }