public ConnectionDrawData(string id, SocketHandle port1, SocketHandle port2, UILineRendererWithListener lineRenderer)
 {
     this.id           = id;
     this.output       = port1;
     this.input        = port2;
     this.lineRenderer = lineRenderer;
 }
        public void Init()
        {
            _connections    = new Dictionary <string, ConnectionDrawData>();
            _lineContainer  = lineContainer;
            _pointerLocator = pointerLocator;
            _lineRenderer   = CreateLine();
            _hasRequest     = false;

            CancelDrag();
        }
        //  drawing
        private void DrawConnection(SocketHandle port1, SocketHandle port2, UILineRendererWithListener lineRenderer)
        {
            var pointList = new List <Vector2>();

            for (float i = 0; i < vertexCount; i++)
            {
                var t = i / vertexCount;
                pointList.Add(Utility.CubicCurve(GetLocalPoint(port1.handle1.position),
                                                 GetLocalPoint(port1.handle2.position),
                                                 GetLocalPoint(port2.handle1.position),
                                                 GetLocalPoint(port2.handle2.position),
                                                 t));
            }

            lineRenderer.m_points = pointList.ToArray();
            lineRenderer.SetVerticesDirty();
        }