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; }
public virtual void Init(OSM_Node parent) { name = "connection"; parentNode = parent; }
public abstract void PushToEnd(OSM_Node node);
public abstract void Remove(OSM_Node node);
public abstract void Add(OSM_Node n, Vector2 position);