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

            if (stateMachine != null)
            {
                stateMachine.Stop();
            }
        }
Ejemplo n.º 3
0
        public override void OnStateBegin()
        {
            ArborFSM target = _Target.value as ArborFSM;

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

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