예제 #1
0
 internal void DoSelectionToggle(Rect rect)
 {
     foreach (var view in CaclulateSelectedNodes(rect))
     {
         GraphWindow.ToggleSelectNode(view);
     }
 }
예제 #2
0
        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);
            }
        }
예제 #3
0
 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);
         }
     }
 }
예제 #4
0
 public void OnLeftUp(MouseUpEvent evt)
 {
     GraphWindow.UnselectNodes();
 }
예제 #5
0
 public void OnRightMouseUp(MouseUpEvent evt)
 {
     GraphWindow.Disconnect(this);
 }
예제 #6
0
 public void OnLeftMouseUp(MouseUpEvent evt)
 {
     GraphWindow.ClickedPort(this);
 }
예제 #7
0
 public void OnDrag(MouseMoveEvent evt, Vector3 delta)
 {
     BringToFront();
     GraphWindow.DragNodes(delta);
 }
예제 #8
0
 public void OnDown(MouseDownEvent evt)
 {
     BringToFront();
     GraphWindow.SelectNode(this);
 }
예제 #9
0
 public void OnAddSelect(MouseDownEvent evt)
 {
     GraphWindow.ToggleSelectNode(this);
 }
예제 #10
0
 protected override void OnChange()
 {
     GraphWindow.MarkDirty();
 }