public static SplineBase GenerateBranch(SplineBase splineA, SplineBase splineB, float from, float to, SplineBase.PositionUnits positionUnits)
        {
            BranchBetweenSplines branch = GameObject.Instantiate(Resources.Load <BranchBetweenSplines>("BRANCH_SPLINE"));

            branch.Construct(splineA, splineB, from, to, positionUnits);
            return(branch.SplineBase);
        }
 public void Construct(SplineBase splineA, SplineBase splineB, float from, float to, SplineBase.PositionUnits positionUnits)
 {
     _splineA       = splineA;
     _splineB       = splineB;
     _pathPositionA = from;
     _pathPositionB = to;
     _positionUnits = positionUnits;
     ConstructSpline();
 }
示例#3
0
        public override bool AreSplinesSimilare(SplineBase splineA, SplineBase splineB)
        {
            Spline A = splineA as Spline;
            Spline B = splineB as Spline;

            if (A == null || B == null)
            {
                return(false);
            }
            for (int i = 0; i < A.Waypoints.Length; i++)
            {
                if (!Waypoint.AreEqual(A.Waypoints[i], B.Waypoints[i]))
                {
                    Debug.Log("not equal waypoints " + i);
                    return(false);
                }
            }
            return(true);
        }
示例#4
0
        public override bool AreSplinesSimilare(SplineBase splineA, SplineBase splineB)
        {
            SplineSmooth A = splineA as SplineSmooth;
            SplineSmooth B = splineB as SplineSmooth;

            if (A == null || B == null)
            {
                return(false);
            }

            for (int i = 0; i < A.Waypoints.Length; i++)
            {
                if (!Waypoint.AreEqual(A.Waypoints[i], B.Waypoints[i]))
                {
                    return(false);
                }
            }
            return(true);
        }
示例#5
0
 public void RemoveSpline(SplineBase spline)
 {
     _splineLister.Remove(spline);
 }
示例#6
0
 public void AddSpline(SplineBase spline)
 {
     _splineLister.AddIfNotContain(spline);
 }
示例#7
0
 public abstract bool AreSplinesSimilare(SplineBase splineA, SplineBase splineB);