public UINode(Vector2 pos, Vector2 size) : base("Transformation: ", pos, size) { _display = new DisplayNode(null); _in = new UIInConnectionPoint(new Rect(Rect.position, new Vector2(50, 50)), Connect); _transformation = new InputNode(); _input = new InputNode(); _out = new UIOutConnectionPoint(new Rect(Rect.position, new Vector2(50, 50)), new OutConnection(_transformation)); }
/// <summary> /// when a connection is created add it to the connections list to draw /// </summary> /// <param name="out">the ui element associated with the out connection</param> /// <param name="in">the ui element associated with the in connection</param> private void OnConnectionCreated(UIOutConnectionPoint @out, UIInConnectionPoint @in) { if (@out != null && @in != null) { Connections.Add(new UIBezierConnection(@out, @in)); } CurrentSendingDrag = null; CurrentAcceptingDrag = null; }
public static void RequestConnection(UIOutConnectionPoint uiOut, IConnectionOut @out) { if (CurrentAcceptingDrag.ValidateConnection(@out)) { ConnectionCreatedEvent.Invoke(CurrentSendingDrag, CurrentAcceptingDrag); } else { Debug.Log("cancel connection request"); CurrentAcceptingDrag = null; CurrentSendingDrag = null; } }
public UIInputNode(Vector2 pos, Vector2 size) : base("Input Node: ", pos, size) { _node = new InputNode(); _out = new UIOutConnectionPoint(new Rect(Rect.position, new Vector2(50, 50)), new OutConnection(_node)); }