private void DrawNode(OSM_Node node)
        {
            // Convert the node rect from graph to screen space.
            Rect screenRect = node.bodyRect;

            screenRect.position = GraphToScreenSpace(screenRect.position);

            // The node contents are grouped together within the node body.
            BeginGroup(screenRect, backgroundStyle, backColor);

            // Make the body of node local to the group coordinate space.
            Rect localRect = node.bodyRect;

            localRect.position = Vector2.zero;

            // Draw the contents inside the node body, automatically laidout.
            GUILayout.BeginArea(localRect, GUIStyle.none);

            // node.HeaderStyle.normal.background = _headerTex;

            // EditorGUI.BeginChangeCheck();
            // node.OnNodeGUI();
            // if (EditorGUI.EndChangeCheck())
            //     if (onNodeGuiChange != null) onNodeGuiChange(graph, node);

            // GUILayout.EndArea();
            // GUI.EndGroup();
        }
        public static NodeInput Create(OSM_Node parent, bool multipleConnections = false)
        {
            var input = ScriptableObject.CreateInstance <NodeInput>();

            input.Init(parent, multipleConnections);

            NodeConnection.OnConnectionCreated(input);
            return(input);
        }
        public static NodeOutput Create(OSM_Node parent, bool multipleConnections = true)
        {
            var output = ScriptableObject.CreateInstance <NodeOutput>();

            output.Init(parent, multipleConnections);

            NodeConnection.OnConnectionCreated(output);
            return(output);
        }
 public virtual void Init(OSM_Node parent, bool multipleConnections = true)
 {
     base.Init(parent);
     name = "input";
     _bCanHaveMultipleConnections = multipleConnections;
 }
Пример #5
0
 public virtual void Init(OSM_Node parent)
 {
     name       = "connection";
     parentNode = parent;
 }
Пример #6
0
 public abstract void PushToEnd(OSM_Node node);
Пример #7
0
 public abstract void Remove(OSM_Node node);
Пример #8
0
 public abstract void Add(OSM_Node n, Vector2 position);