public virtual void UpdateNodeGUI(Event _e, Rect _viewRect, GUISkin _skin)
        {
            NodeEditorWindow curWindow = EditorWindow.GetWindow <NodeEditorWindow>() as NodeEditorWindow;

            if (curWindow != null)
            {
                int index = curWindow.GetCurrentGraph().m_nodes.IndexOf(this);

                if (index == 0)
                {
                    GUI.color = Color.blue;
                }
                else
                {
                    GUI.color = Color.white;
                }

                m_nodeRect = GUI.Window(index, m_nodeRect, DoMyWindow, m_nodeName);
            }

            ProcessEvents(Event.current);

            GUI.color = Color.white;
            foreach (NodeInput input in m_inputs)
            {
                if (input != null)
                {
                    input.UpdateGUI(this, curWindow);
                }
            }
            foreach (NodeOutput output in m_outputs)
            {
                if (output != null)
                {
                    output.UpdateGUI(this, curWindow);
                }
            }

            if (m_parentGraph.isDragging)
            {
                UpdateNodeIndex(this);
                if (m_inputs[0] != null && m_inputs[0].m_connectedTo != null)
                {
                    m_inputs[0].m_connectedTo.m_holderNode.UpdateNodeIndex(m_inputs[0].m_connectedTo.m_holderNode);
                }

                m_parentGraph.isDragging = false;
            }


            EditorUtility.SetDirty(this);
        }
        public virtual void InitNode()
        {
            NodeEditorWindow curWindow = EditorWindow.GetWindow <NodeEditorWindow>() as NodeEditorWindow;

            m_inputs = new List <NodeInput>();
            index    = curWindow.GetCurrentGraph().m_nodes.Count;
            if (m_nodeType != NodeType.ROOT_NODE)
            {
                NodeInput input = new NodeInput();
                input.m_holderNode = this;

                m_inputs.Add(input);
            }

            m_outputs = new List <NodeOutput>();
            NodeOutput output = new NodeOutput();

            output.m_holderNode = this;

            m_outputs.Add(output);
        }
        public virtual void UpdateGUI(BaseNode _node, NodeEditorWindow _curWindow)
        {
            if (GUI.Button(m_IORect, new GUIContent("")))
            {
                NodeGraph graph = _curWindow.GetCurrentGraph();
                Event     e     = Event.current;
                if (e.button == 1)
                {
                    graph.SetIsMakingConnection(false);
                    graph.m_connectionFrom = null;
                    ProcessContextMenu(e, graph);
                    return;
                }

                if (graph.GetIsMakingConnection() && graph.GetConnectionType() != m_type)
                {
                    if (m_connectedTo != null)
                    {
                        m_connectedTo.m_isOccupied  = false;
                        m_connectedTo.m_connectedTo = null;
                    }

                    Debug.Log("Connection made");
                    m_isOccupied  = true;
                    m_connectedTo = graph.m_connectionFrom;
                    m_connectedTo.m_isOccupied = true;

                    m_connectedTo.m_isOccupied  = true;
                    m_connectedTo.m_connectedTo = this;

                    graph.SetIsMakingConnection(false);
                    graph.m_connectionFrom = null;
                }
                else if (!_curWindow.GetCurrentGraph().GetIsMakingConnection())
                {
                    _curWindow.GetCurrentGraph().SetIsMakingConnection(true);
                    _curWindow.GetCurrentGraph().SetConnectionType(m_type);
                    _curWindow.GetCurrentGraph().SetConnectionStart(m_IORect.center);
                    _curWindow.GetCurrentGraph().m_connectionFrom = this;
                }

                AssetDatabase.AddObjectToAsset(this, m_holderNode);
                AssetDatabase.SaveAssets();
                AssetDatabase.Refresh();
            }
        }