Example #1
0
        /// <summary>
        /// Moves the RectTransform's anchorPosition along a spline with the given average speed.
        /// </summary>
        static public Tween AnchorPosAlongWithSpeed(this RectTransform inRectTransform, ISpline inSpline, float inSpeed, Axis inAxis, SplineTweenSettings inSplineSettings)
        {
            float time;

            switch (inSplineSettings.LerpMethod)
            {
            case SplineLerp.Direct:
            case SplineLerp.Vertex:
                time = inSpline.GetDirectDistance() / inSpeed;
                break;

            case SplineLerp.Precise:
            default:
                time = inSpline.GetDistance() / inSpeed;
                break;
            }

            return(BeauRoutine.Tween.Create(new TweenData_RectTransform_AnchorPosSpline(inRectTransform, inSpline, inAxis, inSplineSettings), time));
        }