DrawCurve() public static method

public static DrawCurve ( Vector2 p1, Vector2 p2 ) : void
p1 Vector2
p2 Vector2
return void
Esempio n. 1
0
        // Draw a line (curve) between the nodes.
        public void DrawLine()
        {
            var p1 = (Vector3)_fromNode.windowPosition;
            var p2 = (Vector3)_toNode.windowPosition;

            p1 += (Vector3)_fromOutlet.buttonRect.center;
            p2 += (Vector3)_toInlet.buttonRect.center;

            EditorUtility.DrawCurve(p1, p2);
        }
Esempio n. 2
0
        // Draw the currently working link.
        void DrawWorkingLink()
        {
            var p1 = (Vector3)_wiring.node.windowPosition;
            var p2 = (Vector3)Event.current.mousePosition;

            if (_wiring.inlet != null)
            {
                // Draw a curve from the inlet button.
                p1 += (Vector3)_wiring.inlet.buttonRect.center;
                EditorUtility.DrawCurve(p2, p1);
            }
            else
            {
                // Draw a curve from the outlet button.
                p1 += (Vector3)_wiring.outlet.buttonRect.center;
                EditorUtility.DrawCurve(p1, p2);
            }

            // Request repaint continuously.
            Repaint();
        }