Beispiel #1
0
 public AdvancedWaypointPathTweenCurve(float dur, WaypointPathComponent path)
     : base()
 {
     _ease  = EaseMethods.LinearEaseNone;
     _dur   = dur;
     _delay = 0f;
     _path  = path;
 }
Beispiel #2
0
 public AdvancedWaypointPathTweenCurve(Ease ease, float dur, float delay, WaypointPathComponent path)
     : base()
 {
     _ease  = ease ?? EaseMethods.LinearEaseNone;
     _dur   = dur;
     _path  = path;
     _delay = delay;
 }
        public static IConfigurableIndexedWaypointPath GetPath(WaypointPathComponent c, bool cloneWaypoints)
        {
            IConfigurableIndexedWaypointPath path = null;

            switch (c._pathType)
            {
            case PathType.Cardinal:
                path = new CardinalSplinePath();
                break;

            case PathType.Linear:
                path = new LinearPath();
                break;

            case PathType.BezierChain:
                path = new BezierChainPath();
                break;

            case PathType.BezierSpline:
                path = new BezierSplinePath();
                break;
            }
            if (path != null)
            {
                path.IsClosed = c._closed;
                if (c._waypoints != null)
                {
                    for (int i = 0; i < c._waypoints.Length; i++)
                    {
                        if (cloneWaypoints)
                        {
                            path.AddControlPoint(new Waypoint(c._waypoints[i]));
                        }
                        else
                        {
                            path.AddControlPoint(c._waypoints[i]);
                        }
                    }
                }
            }
            return(path);
        }