Ejemplo n.º 1
0
        public void ChangeGlobalState(int iStateID)
        {
            if (stateDic.ContainsKey(iStateID))
            {
                globalState.OnDisable();
                globalState = stateDic[iStateID];
                globalState.OnEnable();
                return;
            }

            Debug.LogErrorFormat("[CoreStatemanager] ICoreState isn't exsist.", iStateID);
        }
Ejemplo n.º 2
0
        public void OnUpdate()
        {
            globalState.OnUpdate();
            currentState.OnUpdate();

            if (nextState == null)
            {
                return;
            }

            currentState.OnDisable();

            lastState    = currentState;
            currentState = nextState;
            nextState    = null;

            currentState.OnEnable();
        }