コード例 #1
0
ファイル: FsmGUI.cs プロジェクト: mgal1213/310318_GPWorkshop
        /// <summary>
        /// Refresh all states, recreate the StateGUI list.
        /// </summary>
        public override void Refresh()
        {
            // Create the guiStates
            m_StatesGUI = null;
            var activeFsm = BehaviourWindow.activeFsm;

            if (activeFsm != null)
            {
                var guiStates = new List <StateGUI>();

                // Add states
                var states = activeFsm.states;
                if (states != null)
                {
                    for (int i = 0; i < states.Count; i++)
                    {
                        // Create and adds a new stateGUI
                        guiStates.Add(new StateGUI(guiStates.Count, states[i]));
                    }
                }

                m_StatesGUI = guiStates.ToArray();
            }
            CalculateViewRect();
            StateGUI.ResetDraggedWindow();
        }
コード例 #2
0
 /// <summary>
 /// Clears everything stored in the drag & drop.
 /// </summary>
 public static void AcceptDrag()
 {
     s_CandidateForDrag = null;
     s_TransitionGUI    = null;
     s_Dragging         = null;
     s_StateGUI         = null;
 }
コード例 #3
0
ファイル: FsmGUI.cs プロジェクト: mgal1213/310318_GPWorkshop
 /// <summary>
 /// A Unity callback called when the object will be destroyed.
 /// Reset the guiState dragged window to avoid erros in the blackboard view ignore events and the GUIBehaviourTree.
 /// </summary>
 void OnDestroy()
 {
     StateGUI.ResetDraggedWindow();
 }
コード例 #4
0
        // public static StateTransition dragged;

        #region Methods

        /// <summary>
        /// Clears the current dragging transition and prepares for initiating a drag operation.
        /// <param name="transitionGUI">The transition gui candidate for dragging. You can access it later using the candidateForDrag property.</param>
        /// <param name="guiState">The StateGUI that has the transitionGui.</param>
        /// </summary>
        public static void PrepareStartDrag(TransitionGUI transitionGUI, StateGUI guiState)
        {
            s_CandidateForDrag = transitionGUI;
            s_StateGUI         = guiState;
            s_Dragging         = null;
        }