void CreateFSM() { ArborFSM externalFSM = _ExternalFSM.value as ArborFSM; if (_CacheExternalFSM == externalFSM) { return; } _CacheExternalFSM = externalFSM; if (_RuntimeFSM != null) { ObjectPool.Destroy(_RuntimeFSM.gameObject); _RuntimeFSM = null; } if (_CacheExternalFSM == null) { return; } _RuntimeFSM = NodeGraph.Instantiate <ArborFSM>(_CacheExternalFSM, this, _UsePool.value); _RuntimeFSM.playOnStart = false; _RuntimeFSM.updateSettings.type = UpdateType.Manual; _RuntimeFSM.gameObject.SetActive(false); }
// Use this for enter state public override void OnStateBegin() { ArborFSM stateMachine = _StateMachine.value as ArborFSM; if (stateMachine != null) { stateMachine.Stop(); } }
public override void OnStateBegin() { ArborFSM target = _Target.value as ArborFSM; if (target != null) { target.SendTrigger(_Message.value); } }
protected override void OnExecute() { ArborFSM stateMachine = _StateMachine.value as ArborFSM; if (stateMachine != null) { stateMachine.Play(); FinishExecute(true); } else { FinishExecute(false); } }
void DropNodes(Node[] nodes) { SubStateMachine subStateMachine = target as SubStateMachine; ArborFSM subFSM = subStateMachine.subFSM; Undo.IncrementCurrentGroup(); int undoGroup = Undo.GetCurrentGroup(); Undo.RegisterCompleteObjectUndo(subFSM, "DropNodes"); Clipboard.DuplicateNodes(Vector2.zero, nodes, subFSM, false); graphEditor.DeleteNodes(nodes); Undo.CollapseUndoOperations(undoGroup); }
protected override void OnCreated() { ArborFSM stateMachine = NodeGraph.Create <ArborFSM>(gameObject); ComponentUtility.RecordObject(stateMachine, "Add ArborFSM"); #if !ARBOR_DEBUG stateMachine.hideFlags = HideFlags.HideInInspector | HideFlags.HideInHierarchy; #endif stateMachine.playOnStart = false; stateMachine.updateSettings.type = UpdateType.Manual; stateMachine.ownerBehaviour = this; stateMachine.enabled = false; ComponentUtility.RecordObject(this, "Add ArborFSM"); _StateMachine = stateMachine; }
void INodeGraphContainer.SetNodeGraph(int index, NodeGraph graph) { _StateMachine = graph as ArborFSM; }
void INodeGraphContainer.SetNodeGraph(int index, NodeGraph graph) { _RuntimeFSM = graph as ArborFSM; }