예제 #1
0
        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);
        }
예제 #2
0
        // Use this for enter state
        public override void OnStateBegin()
        {
            ArborFSM stateMachine = _StateMachine.value as ArborFSM;

            if (stateMachine != null)
            {
                stateMachine.Stop();
            }
        }
예제 #3
0
        public override void OnStateBegin()
        {
            ArborFSM target = _Target.value as ArborFSM;

            if (target != null)
            {
                target.SendTrigger(_Message.value);
            }
        }
예제 #4
0
        protected override void OnExecute()
        {
            ArborFSM stateMachine = _StateMachine.value as ArborFSM;

            if (stateMachine != null)
            {
                stateMachine.Play();
                FinishExecute(true);
            }
            else
            {
                FinishExecute(false);
            }
        }
예제 #5
0
        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);
        }
예제 #6
0
        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;
        }
예제 #7
0
 void INodeGraphContainer.SetNodeGraph(int index, NodeGraph graph)
 {
     _StateMachine = graph as ArborFSM;
 }
예제 #8
0
 void INodeGraphContainer.SetNodeGraph(int index, NodeGraph graph)
 {
     _RuntimeFSM = graph as ArborFSM;
 }