コード例 #1
0
        ///Enter a state providing the state itself
        public bool EnterState(FSMState newState)
        {
            if (!isRunning){
                Debug.LogWarning("Tried to EnterState on an FSM that was not running", this);
                return false;
            }

            if (newState == null){
                Debug.LogWarning("Tried to Enter Null State");
                return false;
            }
            /*
            if (currentState == newState){
                Debug.Log("Trying entering the same state");
                return false;
            }
            */
            if (currentState != null){
                currentState.Finish();
                currentState.Reset();
                if (CallbackExit != null)
                    CallbackExit(currentState);

                //for editor..
                foreach (var inConnection in currentState.inConnections)
                    inConnection.connectionStatus = Status.Resting;
                ///
            }

            previousState = currentState;
            currentState = newState;
            currentState.Execute(agent, blackboard);
            if (CallbackEnter != null)
                CallbackEnter(currentState);
            return true;
        }
コード例 #2
0
 public GUIPort(FSMState parent, Vector2 pos)
 {
     this.parent = parent;
     this.pos = pos;
 }
コード例 #3
0
ファイル: FSMState.cs プロジェクト: nemish/cubematters
 public GUIPort(FSMState parent, Vector2 pos)
 {
     this.parent = parent;
     this.pos    = pos;
 }
コード例 #4
0
ファイル: FSM.cs プロジェクト: yasirmx/UmbraFeraMain
 protected override void OnGraphPaused()
 {
     lastState = currentState;
 }
コード例 #5
0
ファイル: FSM.cs プロジェクト: yasirmx/UmbraFeraMain
 protected override void OnGraphStoped()
 {
     lastState    = null;
     currentState = null;
 }
コード例 #6
0
 protected override void OnGraphPaused()
 {
     previousState = currentState;
     currentState  = null;
 }
コード例 #7
0
 protected override void OnGraphStoped()
 {
     previousState = null;
     currentState  = null;
 }
コード例 #8
0
ファイル: FSM.cs プロジェクト: nemish/cubematters
        ///Enter a state providing the state itself
        public bool EnterState(FSMState newState)
        {
            if (!isRunning){
                Debug.LogWarning("Tried to EnterState on an FSM that was not running", this);
                return false;
            }

            if (newState == null){
                Debug.LogWarning("Tried to Enter Null State");
                return false;
            }

            if (currentState != null){

                if (CallbackExit != null){
                    CallbackExit(currentState);
                }

                currentState.Finish();
                currentState.Reset();

                #if UNITY_EDITOR //Done for visualizing in editor
                for (var i = 0; i < currentState.inConnections.Count; i++)
                    currentState.inConnections[i].connectionStatus = Status.Resting;
                #endif
            }

            previousState = currentState;
            currentState = newState;

            if (CallbackEnter != null){
                CallbackEnter(currentState);
            }

            currentState.Execute(agent, blackboard);
            return true;
        }
コード例 #9
0
 protected override void OnGraphStoped()
 {
     previousState = null;
     currentState = null;
 }
コード例 #10
0
 protected override void OnGraphPaused()
 {
     previousState = currentState;
     currentState = null;
 }