Esempio n. 1
0
        public void Draw(EditorWindow window, Rect region, AbstractSocket currentDragingSocket)
        {
            if (centeredLabelStyle == null)
            {
                centeredLabelStyle = GUI.skin.GetStyle("Label");
            }
            centeredLabelStyle.alignment = TextAnchor.MiddleCenter;

            EditorZoomArea.Begin(Zoom, region);

            if (Style.normal.background == null)
            {
                Style.normal.background = CreateBackgroundTexture();
            }
            GUI.DrawTextureWithTexCoords(DrawArea, Style.normal.background, new Rect(0, 0, 1000, 1000));
            DrawArea.Set(Position.x, Position.y, CanvasSize, CanvasSize);
            GUILayout.BeginArea(DrawArea);
            DrawEdges();
            window.BeginWindows();
            DrawNodes();
            window.EndWindows();
            DrawDragEdge(currentDragingSocket);

            for (var i = 0; i < Graph.GetNodeCount(); i++)
            {
                Graph.GetNodeAt(i).GUIDrawSockets();
            }

            GUILayout.EndArea();
            EditorZoomArea.End();
        }
Esempio n. 2
0
        public void Draw(EditorWindow window, Rect region, Socket currentDragingSocket)
        {
            EditorZoomArea.Begin(Zoom, region);
            this.DrawArea.Set(this.Position.x, this.Position.y, CanvasSize, CanvasSize);
            GUILayout.BeginArea(this.DrawArea, this.Style);
            this.DrawEdges();

            window.BeginWindows();
            this.DrawNodes();
            window.EndWindows();
            this.DrawDragEdge(currentDragingSocket);


            for (var i = 0; i < graph.GetNodeCount(); i++)
            {
                graph.GetNodeAt(i).GUIDrawSockets();
            }

            GUILayout.EndArea();
            EditorZoomArea.End();
        }