/// <summary>
        /// Behaviour Machine callback called whenever the active node changes.
        /// </summary>
        void ActiveNodeChanged()
        {
            // Get the active node
            var activeNode = BehaviourWindow.activeNode;

            // Create an editor node for the active node
            m_NodeEditor = activeNode == null ? null : NodeEditor.CreateEditor(activeNode.GetType());
            // Repaint this inspector
            this.Repaint();
        }
예제 #2
0
        /// <summary>
        /// Behaviour Machine callback called whenever the active node changes.
        /// </summary>
        private void ActiveNodeChanged()
        {
            // Get the active node
            ActionNode activeNode = this.GetActiveNode();

            if (activeNode != null)
            {
                // Create an editor node for the active node
                m_NodeEditor = activeNode == null ? null : NodeEditor.CreateEditor(activeNode.GetType());
            }

            // Repaint this inspector
            this.Repaint();
        }
예제 #3
0
        /// <summary>
        /// Selects an Item.
        /// <param name="item">The item to be selected.</param>
        /// </summary>
        void SelecteItem(Item item)
        {
            m_SelectedItem   = item;
            m_SelectedScript = item as Script;

            if (m_SelectedScript != null)
            {
                m_NodeEditor         = NodeEditor.CreateEditor(m_SelectedScript.type);
                m_SelectedNodeSample = ActionNode.CreateInstance(m_SelectedScript.type, null, null);
            }
            // It's a Category?
            else if (item is Category)
            {
                m_CurrentCategory = item as Category;
                m_SelectedScript  = null;
            }

            GUIUtility.hotControl      = 0;
            GUIUtility.keyboardControl = 0;
        }