private void DrawConnectionLine(Event e) { if (_selectedInPoint != null && _selectedOutPoint == null) { Handles.DrawBezier( _selectedInPoint.GetRect().center, e.mousePosition, _selectedInPoint.GetRect().center + Vector2.left * 50f, e.mousePosition - Vector2.left * 50f, Color.white, null, 2f ); GUI.changed = true; } if (_selectedOutPoint != null && _selectedInPoint == null) { Handles.DrawBezier( _selectedOutPoint.GetRect().center, e.mousePosition, _selectedOutPoint.GetRect().center - Vector2.left * 50f, e.mousePosition + Vector2.left * 50f, Color.white, null, 2f ); GUI.changed = true; } }
public void Draw(SDFEditor editor) { Rect outRect = outPoint.GetRect(); Rect inRect = inPoint.GetRect(); Handles.DrawBezier( outRect.center, inRect.center, outRect.center + Vector2.left * 50f, inRect.center - Vector2.left * 50f, Color.white, null, 2f ); if (Handles.Button((inRect.center + outRect.center) * 0.5f, Quaternion.identity, 4, 8, Handles.RectangleHandleCap)) { OnClickRemoveConnection?.Invoke(this); editor.OnClickRemoveConnection(this); } }