Beispiel #1
0
        public override void Connect(SplineBase spline, int pointIndex)
        {
            GameObject      pointGO     = spline.GetPoint(pointIndex);
            SplinePointBase splinePoint = pointGO.GetComponent <SplinePointBase>();

            if (Array.IndexOf(Connections, splinePoint) < 0)
            {
                splinePoint.SetJunction(this);

                Array.Resize(ref Connections, Connections.Length + 1);
                Connections[Connections.Length - 1] = splinePoint;
                m_connections = Connections;
            }
        }
Beispiel #2
0
 public override void Disconnect()
 {
     for (int i = Connections.Length - 1; i >= 0; i--)
     {
         SplinePointBase splinePoint = Connections[i];
         if (splinePoint != null)
         {
             if (splinePoint.GetJunction() == this)
             {
                 splinePoint.SetJunction(null);
             }
         }
     }
     Connections   = new SplinePointBase[0];
     m_connections = Connections;
 }
Beispiel #3
0
 public override void Disconnect(SplineBase spline)
 {
     for (int i = Connections.Length - 1; i >= 0; i--)
     {
         SplinePointBase splinePoint = Connections[i];
         if (splinePoint.Spline == spline)
         {
             if (splinePoint.GetJunction() == this)
             {
                 splinePoint.SetJunction(null);
             }
             Connections   = Connections.RemoveAt(i);
             m_connections = Connections;
         }
     }
 }
Beispiel #4
0
        public override void Disconnect(SplineBase spline, int pointIndex)
        {
            GameObject      pointGO     = spline.GetPoint(pointIndex);
            SplinePointBase splinePoint = pointGO.GetComponent <SplinePointBase>();

            int index = Array.IndexOf(Connections, splinePoint);

            if (index >= 0)
            {
                if (splinePoint.GetJunction() == this)
                {
                    splinePoint.SetJunction(null);
                }
                Connections   = Connections.RemoveAt(index);
                m_connections = Connections;
            }
        }