Beispiel #1
0
        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));
        }
Beispiel #2
0
        /// <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;
        }
Beispiel #3
0
 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));
 }