Beispiel #1
0
        public void SwitchState(string s)
        {
            IState tmpState = this.GetState(s);

            if (tmpState == null)
            {
                Debug.LogWarningFormat("FSMSystem(容错):该状态【{0}】不存在于状态机中!", s);
            }
            if (this.curState != null)
            {
                curState.onExit();
            }
            this.curState = tmpState;
            tmpState.onEnter();
        }