Пример #1
0
        /// <summary>
        /// TODO: Break this up into seperate handlers
        /// </summary>
        void OnGUI()
        {
            GUILayout.Label("PanX: " + Pan.x + " PanY: " + Pan.y);


            Event e = Event.current;

            HandleConnections();
            HandlePanZoom();
            HandleRightClickMenu(e);
            HandleResize(e);



            GUI.BeginGroup(new Rect(0, 0, 100000, 100000));

            BeginWindows();
            SequenceUtils.DrawGridLines(this.position, 30);
            DrawNodes();

            if (isDraggingConnector)
            {
                Rect dragEnd = new Rect(e.mousePosition.x, e.mousePosition.y, 1, 1);
                CurveUtils.DrawNodeCurve(dragStart.position, dragEnd);
            }

            EndWindows();
            GUI.EndGroup();
        }
Пример #2
0
        /* ------------------------------------------- Node Drawing --------------------------------------------- */

        void DrawNodes()
        {
            if (sequence == null || sequence.nodes == null)
            {
                return;
            }
            foreach (int key in sequence.nodes.Keys)
            {
                DrawNode(sequence.nodes[key], key);
                if (sequence.nodes[key].next == null)
                {
                    continue;
                }
                foreach (BaseNode child in sequence.nodes[key].next)
                {
                    CurveUtils.DrawNodeCurve(sequence.nodes[key].position, child.position);
                }
            }
        }