Esempio n. 1
0
 private static void DrawNodes(UTNodeEditorModel editorModel, NodeDrawingPhase phase)
 {
     foreach (UTNode node in editorModel.GetNodes())
     {
         DrawNode(editorModel, node, phase);
     }
 }
Esempio n. 2
0
 private static UTNode GetNodeUnderMouse(UTNodeEditorModel editorModel, Vector2 mousePosition)
 {
     foreach (var node in editorModel.GetNodes())
     {
         if (node.Bounds.Contains(mousePosition))
         {
             return(node);
         }
     }
     return(null);
 }
Esempio n. 3
0
    private static Vector2 CalculateRequiredSize(UTNodeEditorModel editorModel)
    {
        float width  = 0;
        float height = 0;

        foreach (UTNode node in editorModel.GetNodes())
        {
            width  = Mathf.Max(node.Bounds.xMax, width);
            height = Mathf.Max(node.Bounds.yMax, height);
        }
        return(new Vector2(width, height));
    }
Esempio n. 4
0
 private static UTNode.Connector GetConnectorUnderMouse(UTNodeEditorModel editorModel, Vector2 mousePosition)
 {
     foreach (var node in editorModel.GetNodes())
     {
         foreach (var connector in node.Connectors)
         {
             if (connector.connectorPosition.Contains(mousePosition))
             {
                 return(connector);
             }
         }
     }
     return(null);
 }
 private static UTNode GetNodeUnderMouse(UTNodeEditorModel editorModel, Vector2 mousePosition)
 {
     foreach (var node in editorModel.GetNodes()) {
         if (node.Bounds.Contains (mousePosition)) {
             return node;
         }
     }
     return null;
 }
 private static UTNode.Connector GetConnectorUnderMouse(UTNodeEditorModel editorModel, Vector2 mousePosition)
 {
     foreach (var node in editorModel.GetNodes()) {
         foreach (var connector in node.Connectors) {
             if (connector.connectorPosition.Contains (mousePosition)) {
                 return connector;
             }
         }
     }
     return null;
 }
 private static void DrawNodes(UTNodeEditorModel editorModel, NodeDrawingPhase phase)
 {
     foreach (UTNode node in editorModel.GetNodes()) {
         DrawNode (editorModel, node, phase);
     }
 }
 private static Vector2 CalculateRequiredSize(UTNodeEditorModel editorModel)
 {
     float width = 0;
     float height = 0;
     foreach (UTNode node in editorModel.GetNodes()) {
         width = Mathf.Max (node.Bounds.xMax, width);
         height = Mathf.Max (node.Bounds.yMax, height);
     }
     return new Vector2 (width, height);
 }