public static void DrawGraphGizmo(Graph graph, GizmoType type) { Color graphColor = GraphEditorWindow.GetGraphColor(graph); using (new GizmosColor(graphColor)) { foreach (GraphNode node in graph.Nodes) { GraphNodeEditor.DrawGraphNodeGizmo(node, GizmoType.NonSelected); } Color linkColor = Color.gray; if ((type & GizmoType.Selected) != 0) { linkColor = graphColor * 0.75f; } else if ((type & GizmoType.NonSelected) != 0) { linkColor = graphColor * 0.25f; } using (new GizmosColor(linkColor)) { foreach (var links in graph.Links) { GraphNode nodeFrom = links.Key; foreach (GraphNode nodeTo in links.Value) { Vector3 pinShift = GraphEditorWindow.GetGraphNodePinShift(nodeTo); Gizmos.DrawLine(nodeFrom.transform.position + pinShift, nodeTo.transform.position + pinShift); } } } } }
public PannMode(GraphNodeEditor editor) { Editor = editor; }
public ConnectMode(GraphNodeEditor editor, GraphNode node, Vector2 position) { Editor = editor; StartPos = position; ConnectionSource = node; }
public SelectMode(GraphNodeEditor editor) { Editor = editor; }
public NormalMode(GraphNodeEditor editor) { Editor = editor; }
public DragMode(GraphNodeEditor editor) { Editor = editor; }
public ConnectMode(GraphNodeEditor editor, Slot slot, Vector2 position) { Editor = editor; StartPos = position; ConnectionSource = slot; }