/// <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(); }
void OnGUI() { // The actual window code goes here if (SendEventNormalizedNodeEditorWindow.node != null) { if (editor == null) editor = NodeEditor.CreateEditor(SendEventNormalizedNodeEditorWindow.node.GetType()); if (editor.target != SendEventNormalizedNodeEditorWindow.node)//How to add target to editor??? or subclass the Node Editor editor.DrawNode (SendEventNormalizedNodeEditorWindow.node); else editor.OnInspectorGUI (); } }
/// <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; }
/// <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(); }