示例#1
0
 private void DrawNodeConnections(Rect container)
 {
     GUI.depth = -150;
     foreach (var n in Program.Nodes)
     {
         foreach (var c in n.Outputs)
         {
             if (c.Value.Connected)
             {
                 if (connections.ContainsKey(c.Value))
                 {
                     foreach (var c2 in c.Value.Connections)
                     {
                         if (connections.ContainsKey(c2))
                         {
                             Vector2 a = connections[c.Value];
                             Vector2 b = connections[c2];
                             GUILine.DrawLine(GUIUtility.ScreenToGUIPoint(a), GUIUtility.ScreenToGUIPoint(b), ConnectionColor(c.Value), 2, true);
                         }
                     }
                 }
             }
         }
     }
 }
示例#2
0
 public override void Draw()
 {
     GUI.depth = 150;
     if (draggedConnection != null && dragInfo != GUIController.mousePos)
     {
         GUILine.DrawLine(GUIUtility.ScreenToGUIPoint(dragInfo), GUIUtility.ScreenToGUIPoint(GUIController.mousePos), Color.red, 2, true);
     }
     if (Program != null)
     {
         DrawNodes(new Rect(toolbarWidth + 20, GUIController.ElSize, WinRect.width - (toolbarWidth + GUIController.ElSize + 20), WinRect.height - GUIController.ElSize * 2));
     }
     DrawNodeToolbar();
 }