コード例 #1
0
 private static void DrawNodes(UTNodeEditorModel editorModel, NodeDrawingPhase phase)
 {
     foreach (UTNode node in editorModel.GetNodes())
     {
         DrawNode(editorModel, node, phase);
     }
 }
コード例 #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);
 }
コード例 #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));
    }
コード例 #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);
 }
コード例 #5
0
 private static UTNode GetNodeUnderMouse(UTNodeEditorModel editorModel, Vector2 mousePosition)
 {
     foreach (var node in editorModel.GetNodes()) {
         if (node.Bounds.Contains (mousePosition)) {
             return node;
         }
     }
     return null;
 }
コード例 #6
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;
 }
コード例 #7
0
 private static void DrawNodes(UTNodeEditorModel editorModel, NodeDrawingPhase phase)
 {
     foreach (UTNode node in editorModel.GetNodes()) {
         DrawNode (editorModel, node, phase);
     }
 }
コード例 #8
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);
 }