コード例 #1
0
 public void DrawBeziers()
 {
     if (Nexts.Count > 0)
     {
         for (int i = 0; i < Nexts.Count; i++)
         {
             //TBLineRender.DrawBezier(LinkAnchor,
             //    Nexts[i].LinkAnchor,
             //    LinkAnchor + (Nexts[i].LinkAnchor - LinkAnchor) * TBLineRender._bezierLinkForce,
             //    Nexts[i].LinkAnchor + (LinkAnchor - Nexts[i].LinkAnchor) * TBLineRender._bezierLinkForce);
             TBLineRender.DrawLine(NodeRect.position + NodeRect.size / 2, TBWindow.NodesRouter.GetNodeByID(Nexts[i]).NodeRect.position + TBWindow.NodesRouter.GetNodeByID(Nexts[i]).NodeRect.size / 2);
         }
     }
 }
コード例 #2
0
        private void OnGUI()
        {
            if (!_isInit)
            {
                Init();
            }

            _toolbarMenu.PaintComponent();

            InputHandled();

            TBLineRender.PreDrawLine(Event.current.mousePosition);

            GUILayout.BeginVertical();
            {
                CalculateScrollRect();

                _scrollPos = GUI.BeginScrollView(new Rect(0, 18, position.width, position.height), _scrollPos, _scrollRect, true, true);
                {
                    BeginWindows();
                    for (int i = 0; i < _nodesRouter.Count; i++)
                    {
                        if (_nodesRouter[i] != null)
                        {
                            _nodesRouter[i].NodeRect = GUI.Window(_nodesRouter[i].NodeID, _nodesRouter[i].NodeRect, _nodesRouter[i].DrawWindow, _nodesRouter[i].NodeName);
                            _nodesRouter[i].DrawBeziers();
                        }
                    }
                    EndWindows();
                }
                GUI.EndScrollView();
            }
            GUILayout.EndVertical();

            Repaint();
        }