コード例 #1
0
        /// <summary>
        /// Get the all endPoints for a connection with the given start point if existent
        /// </summary>
        /// <param name="inPoint"></param>
        /// <returns></returns>
        public List <IConnectionPoint> GetConnectionPoint(IConnectionPoint startPoint)
        {
            if (startPoint.GetConnectionType() != ConnectionPointType.In)
            {
                Debug.LogError("Unexpeted Connection point type");
            }

            List <IConnectionPoint> outPoints = new List <IConnectionPoint>();

            IEnumerable <Connection> conns = connections.Where(x => x.inPoint == startPoint);

            foreach (var connection in conns)
            {
                outPoints.Add(connection.outPoint);
            }

            return(outPoints);
        }
コード例 #2
0
        /// <summary>
        /// Get the startPoint for a connection with the given end point if existent
        /// </summary>
        /// <param name="inPoint"></param>
        /// <returns></returns>
        public IConnectionPoint GetConnectionStartPoint(IConnectionPoint endPoint)
        {
            if (endPoint.GetConnectionType() != ConnectionPointType.In)
            {
                Debug.LogError("Unexpeted Connection point type");
            }

            IConnectionPoint outPoint = null;

            Connection con = connections.FirstOrDefault(x => x.outPoint == endPoint);

            if (con != null)
            {
                outPoint = con.inPoint;
            }

            return(outPoint);
        }