/************************************************************************************************************************/ private void Awake() { // Note that this class has a [DefaultExecutionOrder] attribute to ensure that this method runs before any // other components that might want to access it. ForceEnterIdleState = () => StateMachine.ForceSetState(_Idle); StateMachine = new FSM.StateMachine <CreatureState>(_Introduction); }
// public void SetRoot(FTNode node) // { // if (root != null) // { // root.IsRoot = false; // } // root = node; // } // public void UnsetRoot(FTNode node) // { // // Only unset when the state passed is the same as the current one. // if (node == root) // { // root = null; // } // } // runtime mode public void InitWithBTTree(FSM.StateMachine tree) { Dictionary <string, FTNode> mapping = new Dictionary <string, FTNode>(); for (int i = 0; i < nodes.Count; ++i) { if ((nodes[i] is FTNode) == false) { continue; } FTNode FTNode = nodes[i] as FTNode; mapping[FTNode.id] = FTNode; } // InitWithFTNode(tree, mapping); }
/************************************************************************************************************************/ // Note that this class has a [DefaultExecutionOrder] attribute to ensure that this method runs before any // other components that might want to access it. private void Awake() { ForceEnterIdleState = () => StateMachine.ForceSetState(_Idle); StateMachine = new FSM.StateMachine <CreatureState>(_Introduction); }
/************************************************************************************************************************/ private void Awake() { ForceEnterIdleState = () => StateMachine.ForceSetState(_Idle); StateMachine = new FSM.StateMachine <PlatformerCreatureState>(_Idle); }