コード例 #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);
        }
コード例 #2
0
        public void OnUpdate()
        {
            globalState.OnUpdate();
            currentState.OnUpdate();

            if (nextState == null)
            {
                return;
            }

            currentState.OnDisable();

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

            currentState.OnEnable();
        }