internal void DoSelectionToggle(Rect rect) { foreach (var view in CaclulateSelectedNodes(rect)) { GraphWindow.ToggleSelectNode(view); } }
public NodeView(Node node) : base() { this.node = node; this.name = node.GetType().Name; title.text = node.view.title; collapse.clickable.clicked += ToggleCollapse; duplicate.clickable.clicked += () => { GraphWindow.DuplicateNode(node); }; delete.clickable.clicked += () => { GraphWindow.RemoveNode(node); }; SetCollapsed(); Load(); if (typeof(GraphPortNode).IsAssignableFrom(this.node.GetType())) { AddToClassList("GraphPort"); } if (typeof(Graph).IsAssignableFrom(this.node.GetType())) { AddToClassList("SubGraph"); } properties.Bind(new SerializedObject(node)); foreach (Port item in node.ports) { CreatePortViews(item); } }
protected override void OnGUI() { if (Target.parent == null) { if (GUILayout.Button("Open Editor", GUILayout.Height(25))) { GraphWindow.Open(); GraphWindow.LoadGraph(Target); } if (GUILayout.Button("Execute", GUILayout.Height(25))) { GraphWindow.Execute(); } } else { if (GUILayout.Button("Open Graph", GUILayout.Height(25))) { GraphWindow.Open(); GraphWindow.LoadSubGraph(Target); } } }
public void OnLeftUp(MouseUpEvent evt) { GraphWindow.UnselectNodes(); }
public void OnRightMouseUp(MouseUpEvent evt) { GraphWindow.Disconnect(this); }
public void OnLeftMouseUp(MouseUpEvent evt) { GraphWindow.ClickedPort(this); }
public void OnDrag(MouseMoveEvent evt, Vector3 delta) { BringToFront(); GraphWindow.DragNodes(delta); }
public void OnDown(MouseDownEvent evt) { BringToFront(); GraphWindow.SelectNode(this); }
public void OnAddSelect(MouseDownEvent evt) { GraphWindow.ToggleSelectNode(this); }
protected override void OnChange() { GraphWindow.MarkDirty(); }