示例#1
0
文件: BoxLink.cs 项目: fbizuneh/Igor
        public BoxLink(Anchor <EntityType> FromAnchor, Anchor <EntityType> ToAnchor)
        {
            StartAnchor = FromAnchor.IsInput() ? FromAnchor : ToAnchor;
            EndAnchor   = FromAnchor.IsInput() ? ToAnchor : FromAnchor;

            OnConnectAnchors();
        }
示例#2
0
文件: BoxLink.cs 项目: fbizuneh/Igor
        public virtual void DrawLink(Vector2 Offset)
        {
            Color LineColor = Color.blue;

            if (bHighlighted)
            {
                LineColor = Color.red;
            }

            if (EndAnchor != null)
            {
                VisualScriptingDrawing.curveFromTo(EndAnchor.LastRect, StartAnchor.LastRect, LineColor, Color.green, Offset);
            }
            else
            {
                Vector2 MousePosition = InputState.GetLocalMousePosition(StartAnchor.Owner.Owner, Vector2.zero);
                Rect    MouseRect     = new Rect(MousePosition.x, MousePosition.y, 0.0f, 0.0f);

                if (StartAnchor.IsInput())
                {
                    VisualScriptingDrawing.curveFromTo(MouseRect, StartAnchor.LastRect, LineColor, Color.green, Offset);
                }
                else
                {
                    VisualScriptingDrawing.curveFromTo(StartAnchor.LastRect, MouseRect, LineColor, Color.green, Offset);
                }
            }
        }