private void DrawConnectionLine(Event e) { if (selectedInPoint != null && selectedOutPoint == null) { Handles.DrawBezier( selectedInPoint.GetCenter(), e.mousePosition, selectedInPoint.GetCenter() + Vector2.left * 50f, e.mousePosition - Vector2.left * 50f, Color.white, null, 2f ); GUI.changed = true; } if (selectedOutPoint != null && selectedInPoint == null) { Handles.DrawBezier( selectedOutPoint.GetCenter(), e.mousePosition, selectedOutPoint.GetCenter() - Vector2.left * 50f, e.mousePosition + Vector2.left * 50f, Color.white, null, 2f ); GUI.changed = true; } }
public void Draw() { Handles.DrawBezier( inPoint.GetCenter(), outPoint.GetCenter(), inPoint.GetCenter() + Vector2.left * 50f, outPoint.GetCenter() - Vector2.left * 50f, Color.white, null, 2f ); if (inPoint.node != outPoint.node) { if (Handles.Button((inPoint.rect.center + outPoint.rect.center) * 0.5f, Quaternion.identity, 4, 8, Handles.RectangleCap)) { if (OnClickRemoveConnection != null) { OnClickRemoveConnection(this); } } } else { if (Handles.Button(outPoint.GetCenter() + Vector2.right * 15f, Quaternion.identity, 4, 8, Handles.RectangleCap)) { if (OnClickRemoveConnection != null) { OnClickRemoveConnection(this); } } } outPoint.node.story.ConnectInteraction(outPoint.interactionName, inPoint.node.story); }