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; } } }
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; }
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; } }