Exemplo n.º 1
0
        protected override State GetToState()
        {
            if (!(toState is ParentState))
            {
                Debug.LogError("ParentState required");
            }
            else if (entryState == ToStateType.DefaultStartState)
            {
                ParentState parentState = (ParentState)toState;

                parentState.StateHFSM.ResetToStartState();
            }

            return(toState);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Adding a parent HFSM node.
        /// </summary>
        /// <param name="sender"></param>
        void AddHFSMCallBack(object pos)
        {
            if (Selection.activeTransform == false)
            {
                return;
            }

            Vector2     position = (Vector2)pos;
            ParentState state    = Selection.activeGameObject.AddComponent <ParentState>();

            state.hideFlags           = HideFlags.HideInInspector;
            state.StateHFSM           = Selection.activeGameObject.AddComponent <HFSM>();
            state.StateHFSM.hideFlags = HideFlags.HideInInspector;
            state.StateHFSM.hfsmName  = state.StateName;
            hfsms.Add(state.StateHFSM);
            state.nodeEditorLoc = position;

            AddNode(state);
        }