Beispiel #1
0
 private void DrawInputs()
 {
     if (node.Inputs != null)
     {
         var   i       = 0;
         Event current = Event.current;
         foreach (var input in node.Inputs)
         {
             var buttonPosition = new Rect(0, nodeConfig.TopMargin + (nodeConfig.InputSize * i), nodeConfig.InputSize, nodeConfig.InputSize * 0.5f);
             if (buttonPosition.Contains(current.mousePosition))
             {
                 DrawDescription = true;
                 Description     = input.Description;
                 HelpPosition    = new Rect(node.XPosition + 30, node.YPosition - 30, 0, 0);
             }
             if (GUI.Button(buttonPosition, "",
                            nodeConfig.GetConnectionStyle(input.IsWarm, input.Type)))
             {
                 if (current.button == 0)
                 {
                     linkEditor.AddLinkFromInput(input);
                 }
                 else
                 {
                     DrawDescription = true;
                     Description     = input.Description;
                 }
             }
             i++;
         }
     }
 }
Beispiel #2
0
 private void DrawInputs()
 {
     if (node.Inputs != null)
     {
         var i = 0;
         foreach (var input in node.Inputs)
         {
             if (GUI.Button(new Rect(0, nodeConfig.TopMargin + (nodeConfig.InputSize * i), nodeConfig.InputSize, nodeConfig.InputSize), "",
                            nodeConfig.GetConnectionStyle(input.IsWarm, input.Type)))
             {
                 Event current = Event.current;
                 if (current.button == 0)
                 {
                     linkEditor.AddLinkFromInput(input);
                 }
                 else
                 {
                     DrawDescription = true;
                     Description     = input.Description;
                 }
             }
             i++;
         }
     }
 }