예제 #1
0
        public override void Update(Rect editorRect, Rect precentageRect, Event e, NodeGraph curGraph)
        {
            base.Update(editorRect, precentageRect, e, curGraph);

            viewTitle = curGraph == null ? "No Graph" : curGraph.name;

            GUI.Box(viewRect, viewTitle, viewSkin.GetStyle("View Background"));
            NodeUtils.DrawGrid(editorRect, 50f, .15f, Color.white);

            GUILayout.BeginArea(viewRect);
            curGraph?.UpdateGraphUI(e, viewRect, viewSkin);

            if (isSelecting)
            {
                EditorGUI.DrawRect(selection, Color.yellow);
            }
            if (isConnecting)
            {
                Handles.BeginGUI();
                Handles.DrawBezier(
                    connectionSource.Edge,
                    e.mousePosition,
                    connectionSource.Edge + Vector2.right * 50,
                    e.mousePosition + Vector2.left * 50,
                    Color.white,
                    null,
                    4f
                    );
                Handles.EndGUI();
            }

            GUILayout.EndArea();
        }
예제 #2
0
 public override void UpdateView(Event e, Rect _editorRect, Rect _percentageRect, NodeGraph _graph)
 {
     base.UpdateView(e, _editorRect, _percentageRect, _graph);
     GUI.Box(viewRect, viewTitle, this.viewSkin.GetStyle("ViewBG"));
     NodeUtils.DrawGrid(viewRect, 50f, 0.25f, Color.white);
     GUILayout.BeginArea(viewRect);
     if (currentGraph != null)
     {
         currentGraph.UpdateGraphGUI(e, viewRect, this.viewSkin);
     }
     GUILayout.EndArea();
     ProcessEvents(e);
 }
예제 #3
0
    public override void UpdateView(Rect editorRect, Rect precentageRect, Event e, NodeGraph currentGraph)
    {
        base.UpdateView(editorRect, precentageRect, e, currentGraph);
//		Debug.Log ("Updating work view...");

        GUI.Box(viewRect, viewTitle, viewSkin.GetStyle("ViewBG"));

        // draw grid
        NodeUtils.DrawGrid(viewRect, 60f, 0.15f, Color.white);
        // NodeUtils.DrawGrid (viewRect, 20f, 0.1f, Color.white);

        GUILayout.BeginArea(viewRect);
//		EditorGUILayout.LabelField ("this is a label");
        if (currentGraph != null)
        {
            currentGraph.UpdateGraphGUI(e, viewRect, viewSkin);
        }
        GUILayout.EndArea();

        ProcessEvent(e);
    }
    public override void UpdateView(Rect editorRect, Rect percentRect, Event e, NodeGraph curGraph)
    {
        base.UpdateView(editorRect, percentRect, e, curGraph);

        //Demarcate view
        GUI.Box(viewRect, viewTitle, viewSkin.GetStyle("viewBG"));

        //Draw Grid
        NodeUtils.DrawGrid(viewRect, 60f, 0.15f, Color.white);
        NodeUtils.DrawGrid(viewRect, 20f, 0.05f, Color.white);

        GUILayout.BeginArea(viewRect);
        if (curGraph != null)
        {
            curGraph.UpdateGraphGUI(e, viewRect, viewSkin);
        }

        GUILayout.EndArea();

        ProcessEvents(e);
    }