Beispiel #1
0
    /**
     * TODO
     */
    public void Draw()
    {
        pointRect.y  = pointNode.nodeRect.y + (pointNode.nodeRect.height * 0.5f) - pointRect.height * 0.5f;
        pointRect.y += pointOffset;

        switch (pointType)
        {
        case ConnectionPointViewType.In:
            pointRect.x = pointNode.nodeRect.x - pointRect.width + 7.0f;
            break;

        case ConnectionPointViewType.Out:
            pointRect.x = pointNode.nodeRect.x + pointNode.nodeRect.width - 7.0f;
            break;
        }

        if (GUI.Button(pointRect, "", pointStyle))
        {
            if (pointType == ConnectionPointViewType.In)
            {
                PatternEditorNodeView.OnClickInPoint(this);
            }
            else
            {
                PatternEditorNodeView.OnClickOutPoint(this);
            }
        }
    }
    /**
     * TODO
     */
    public static void OpenPatternEditorNodeView()
    {
        PatternEditorNodeView window = GetWindow <PatternEditorNodeView>();

        // Setting up the window
        window.titleContent = new GUIContent("Node view");
        window.minSize      = new Vector2(1280.0f, 720.0f);

        float x = (Screen.width - window.minSize.x) / 2.0f;
        float y = (Screen.height - window.minSize.y) / 2.0f;

        // Resizing and centering the window
        window.position = new Rect(x, y, window.minSize.x, window.minSize.y);
    }
Beispiel #3
0
    public void Draw()
    {
        Handles.DrawBezier
        (
            inPointView.pointRect.center,
            outPointView.pointRect.center,
            inPointView.pointRect.center + Vector2.left * 50f,
            outPointView.pointRect.center - Vector2.left * 50f,
            Color.white,
            null,
            2f
        );

        if (Handles.Button((inPointView.pointRect.center + outPointView.pointRect.center) * 0.5f, Quaternion.identity, 4, 8, Handles.RectangleHandleCap))
        {
            PatternEditorNodeView.OnClickRemoveConnection(this);
        }
    }
 /**
  * TODO
  */
 private void OnEnable()
 {
     instance = this;
     PatternEditorSkinModel.LoadSkins();
 }
 static void Init()
 {
     PatternEditorNodeView.OpenPatternEditorNodeView();
 }