private void StartAlphaTween(float targetAlpha, float duration, TweenEasing easing)
        {
            if (this.m_Image == null)
            {
                return;
            }

            // Check if currently transitioning
            if (this.m_Transitioning)
            {
                this.m_FloatTweenRunner.StopTween();
            }

            if (duration == 0f || !Application.isPlaying)
            {
                this.SetAlpha(targetAlpha);
            }
            else
            {
                this.m_Transitioning = true;

                var floatTween = new FloatTween {
                    duration = duration, startFloat = this.m_Image.canvasRenderer.GetAlpha(), targetFloat = targetAlpha
                };
                floatTween.AddOnChangedCallback(SetAlpha);
                floatTween.ignoreTimeScale = true;
                floatTween.easing          = easing;
                floatTween.AddOnFinishCallback(OnTweenFinished);

                this.m_FloatTweenRunner.StartTween(floatTween);
            }
        }
Beispiel #2
0
        /// <summary>
        /// Starts alpha tween.
        /// </summary>
        /// <param name="targetAlpha">Target alpha.</param>
        /// <param name="duration">Duration.</param>
        /// <param name="easing">Easing.</param>
        /// <param name="ignoreTimeScale">If set to <c>true</c> ignore time scale.</param>
        /// <param name="callback">Event to be called on transition finish.</param>
        public void StartAlphaTween(float targetAlpha, float duration, TweenEasing easing, bool ignoreTimeScale, Events.UnityAction callback)
        {
            if (this.m_CanvasGroup == null)
            {
                return;
            }

            // Start the tween
            var floatTween = new FloatTween {
                duration = duration, startFloat = this.m_CanvasGroup.alpha, targetFloat = targetAlpha
            };

            floatTween.AddOnChangedCallback(SetCanvasAlpha);
            floatTween.AddOnFinishCallback(callback);
            floatTween.ignoreTimeScale = ignoreTimeScale;
            floatTween.easing          = easing;
            this.m_FloatTweenRunner.StartTween(floatTween);
        }
Beispiel #3
0
        /// <summary>
        /// Transition the scene out.
        /// </summary>
        /// <param name="transition">The transition.</param>
        /// <param name="duration">The transition duration.</param>
        /// <param name="easing">The transition easing.</param>
        public void TransitionOut(Transition transition, float duration, TweenEasing easing)
        {
            // Make sure the scene is active and enabled
            if (!this.isActiveAndEnabled || !this.gameObject.activeInHierarchy)
            {
                return;
            }

            if (this.m_CanvasGroup == null)
            {
                return;
            }

            // If no transition is used
            if (transition == Transition.None)
            {
                this.Deactivate();
                return;
            }

            // If the transition is animation
            if (transition == Transition.Animation)
            {
                this.TriggerAnimation(this.m_AnimateOutTrigger);
                return;
            }

            // Make the scene non interactable
            //this.m_CanvasGroup.interactable = false;
            //this.m_CanvasGroup.blocksRaycasts = false;

            // Prepare some variable
            Vector2 rectSize = this.rectTransform.rect.size;

            // Prepare the rect transform
            if (transition == Transition.SlideFromLeft || transition == Transition.SlideFromRight || transition == Transition.SlideFromTop || transition == Transition.SlideFromBottom)
            {
                // Anchor and pivot top left
                this.rectTransform.pivot            = new Vector2(0f, 1f);
                this.rectTransform.anchorMin        = new Vector2(0f, 1f);
                this.rectTransform.anchorMax        = new Vector2(0f, 1f);
                this.rectTransform.sizeDelta        = rectSize;
                this.rectTransform.anchoredPosition = new Vector2(0f, 0f);
            }

            // Prepare the tween
            FloatTween floatTween = new FloatTween();

            floatTween.duration = duration;

            switch (transition)
            {
            case Transition.CrossFade:
                this.m_CanvasGroup.alpha = 1f;
                // Start the tween
                floatTween.startFloat  = this.m_CanvasGroup.alpha;
                floatTween.targetFloat = 0f;
                floatTween.AddOnChangedCallback(SetCanvasAlpha);
                break;

            case Transition.SlideFromRight:
                // Start the tween
                floatTween.startFloat  = 0f;
                floatTween.targetFloat = (rectSize.x * -1f);
                floatTween.AddOnChangedCallback(SetPositionX);
                break;

            case Transition.SlideFromLeft:
                // Start the tween
                floatTween.startFloat  = 0f;
                floatTween.targetFloat = rectSize.x;
                floatTween.AddOnChangedCallback(SetPositionX);
                break;

            case Transition.SlideFromBottom:
                // Start the tween
                floatTween.startFloat  = 0f;
                floatTween.targetFloat = rectSize.y;
                floatTween.AddOnChangedCallback(SetPositionY);
                break;

            case Transition.SlideFromTop:
                // Start the tween
                floatTween.startFloat  = 0f;
                floatTween.targetFloat = (rectSize.y * -1f);
                floatTween.AddOnChangedCallback(SetPositionY);
                break;
            }

            // Start the transition
            floatTween.AddOnFinishCallback(OnTransitionOut);
            floatTween.ignoreTimeScale = true;
            floatTween.easing          = easing;
            this.m_FloatTweenRunner.StartTween(floatTween);
        }
        /// <summary>
        /// Apply the specified easingType, t, b, c and d.
        /// </summary>
        /// <param name="e">Easing type.</param>
        /// <param name="t">Elapsed time.</param>
        /// <param name="b">Starting value.</param>
        /// <param name="c">Target value.</param>
        /// <param name="d">Duration.</param>
        public static float Apply(TweenEasing e, float t, float b, float c, float d)
        {
            switch (e)
            {
            case TweenEasing.Swing:
            {
                return(-c * (t /= d) * (t - 2f) + b);
            }

            case TweenEasing.InQuad:
            {
                return(c * (t /= d) * t + b);
            }

            case TweenEasing.OutQuad:
            {
                return(-c * (t /= d) * (t - 2) + b);
            }

            case TweenEasing.InOutQuad:
            {
                if ((t /= d / 2) < 1)
                {
                    return(c / 2 * t * t + b);
                }
                return(-c / 2 * ((--t) * (t - 2) - 1) + b);
            }

            case TweenEasing.InCubic:
            {
                return(c * (t /= d) * t * t + b);
            }

            case TweenEasing.OutCubic:
            {
                return(c * ((t = t / d - 1) * t * t + 1) + b);
            }

            case TweenEasing.InOutCubic:
            {
                if ((t /= d / 2) < 1)
                {
                    return(c / 2 * t * t * t + b);
                }
                return(c / 2 * ((t -= 2) * t * t + 2) + b);
            }

            case TweenEasing.InQuart:
            {
                return(c * (t /= d) * t * t * t + b);
            }

            case TweenEasing.OutQuart:
            {
                return(-c * ((t = t / d - 1) * t * t * t - 1) + b);
            }

            case TweenEasing.InOutQuart:
            {
                if ((t /= d / 2) < 1)
                {
                    return(c / 2 * t * t * t * t + b);
                }
                return(-c / 2 * ((t -= 2) * t * t * t - 2) + b);
            }

            case TweenEasing.InQuint:
            {
                return(c * (t /= d) * t * t * t * t + b);
            }

            case TweenEasing.OutQuint:
            {
                return(c * ((t = t / d - 1) * t * t * t * t + 1) + b);
            }

            case TweenEasing.InOutQuint:
            {
                if ((t /= d / 2) < 1)
                {
                    return(c / 2 * t * t * t * t * t + b);
                }
                return(c / 2 * ((t -= 2) * t * t * t * t + 2) + b);
            }

            case TweenEasing.InSine:
            {
                return(-c *Mathf.Cos(t / d *(Mathf.PI / 2)) + c + b);
            }

            case TweenEasing.OutSine:
            {
                return(c * Mathf.Sin(t / d * (Mathf.PI / 2)) + b);
            }

            case TweenEasing.InOutSine:
            {
                return(-c / 2 * (Mathf.Cos(Mathf.PI * t / d) - 1) + b);
            }

            case TweenEasing.InExpo:
            {
                return((t == 0) ? b : c *Mathf.Pow(2, 10 *(t / d - 1)) + b);
            }

            case TweenEasing.OutExpo:
            {
                return((t == d) ? b + c : c *(-Mathf.Pow(2, -10 * t / d) + 1) + b);
            }

            case TweenEasing.InOutExpo:
            {
                if (t == 0)
                {
                    return(b);
                }
                if (t == d)
                {
                    return(b + c);
                }
                if ((t /= d / 2) < 1)
                {
                    return(c / 2 * Mathf.Pow(2, 10 * (t - 1)) + b);
                }
                return(c / 2 * (-Mathf.Pow(2, -10 * --t) + 2) + b);
            }

            case TweenEasing.InCirc:
            {
                return(-c * (Mathf.Sqrt(1 - (t /= d) * t) - 1) + b);
            }

            case TweenEasing.OutCirc:
            {
                return(c * Mathf.Sqrt(1 - (t = t / d - 1) * t) + b);
            }

            case TweenEasing.InOutCirc:
            {
                if ((t /= d / 2) < 1)
                {
                    return(-c / 2 * (Mathf.Sqrt(1 - t * t) - 1) + b);
                }
                return(c / 2 * (Mathf.Sqrt(1 - (t -= 2) * t) + 1) + b);
            }

            case TweenEasing.InBack:
            {
                float s = 1.70158f;
                return(c * (t /= d) * t * ((s + 1f) * t - s) + b);
            }

            case TweenEasing.OutBack:
            {
                float s = 1.70158f;
                return(c * ((t = t / d - 1f) * t * ((s + 1f) * t + s) + 1f) + b);
            }

            case TweenEasing.InOutBack:
            {
                float s = 1.70158f;
                if ((t /= d / 2f) < 1f)
                {
                    return(c / 2f * (t * t * (((s *= (1.525f)) + 1f) * t - s)) + b);
                }
                return(c / 2f * ((t -= 2f) * t * (((s *= (1.525f)) + 1f) * t + s) + 2f) + b);
            }

            case TweenEasing.InBounce:
            {
                return(c - TweenEasingHandler.Apply(TweenEasing.OutBounce, d - t, 0f, c, d) + b);
            }

            case TweenEasing.OutBounce:
            {
                if ((t /= d) < (1f / 2.75f))
                {
                    return(c * (7.5625f * t * t) + b);
                }
                else if (t < (2f / 2.75f))
                {
                    return(c * (7.5625f * (t -= (1.5f / 2.75f)) * t + .75f) + b);
                }
                else if (t < (2.5f / 2.75f))
                {
                    return(c * (7.5625f * (t -= (2.25f / 2.75f)) * t + .9375f) + b);
                }
                else
                {
                    return(c * (7.5625f * (t -= (2.625f / 2.75f)) * t + .984375f) + b);
                }
            }

            case TweenEasing.InOutBounce:
            {
                if (t < d / 2f)
                {
                    return(TweenEasingHandler.Apply(TweenEasing.InBounce, t * 2f, 0f, c, d) * .5f + b);
                }
                return(TweenEasingHandler.Apply(TweenEasing.OutBounce, t * 2f - d, 0f, c, d) * .5f + c * .5f + b);
            }

            case TweenEasing.InElastic:
            {
                float s = 1.70158f; float p = 0f; float a = c;
                if (t == 0f)
                {
                    return(b);
                }
                if ((t /= d) == 1f)
                {
                    return(b + c);
                }
                if (p == 0f)
                {
                    p = d * .3f;
                }
                if (a < Mathf.Abs(c))
                {
                    a = c; s = p / 4f;
                }
                else
                {
                    s = p / (2f * Mathf.PI) * Mathf.Asin(c / a);
                }
                if (float.IsNaN(s))
                {
                    s = 0f;
                }
                return(-(a * Mathf.Pow(2f, 10f * (t -= 1f)) * Mathf.Sin((t * d - s) * (2f * Mathf.PI) / p)) + b);
            }

            case TweenEasing.OutElastic:
            {
                float s = 1.70158f; float p = 0f; float a = c;
                if (t == 0f)
                {
                    return(b);
                }
                if ((t /= d) == 1f)
                {
                    return(b + c);
                }
                if (p == 0f)
                {
                    p = d * .3f;
                }
                if (a < Mathf.Abs(c))
                {
                    a = c; s = p / 4f;
                }
                else
                {
                    s = p / (2f * Mathf.PI) * Mathf.Asin(c / a);
                }
                if (float.IsNaN(s))
                {
                    s = 0f;
                }
                return(a * Mathf.Pow(2f, -10f * t) * Mathf.Sin((t * d - s) * (2f * Mathf.PI) / p) + c + b);
            }

            case TweenEasing.InOutElastic:
            {
                float s = 1.70158f; float p = 0f; float a = c;
                if (t == 0f)
                {
                    return(b);
                }
                if ((t /= d / 2f) == 2f)
                {
                    return(b + c);
                }
                if (p == 0f)
                {
                    p = d * (.3f * 1.5f);
                }
                if (a < Mathf.Abs(c))
                {
                    a = c; s = p / 4f;
                }
                else
                {
                    s = p / (2f * Mathf.PI) * Mathf.Asin(c / a);
                }
                if (float.IsNaN(s))
                {
                    s = 0f;
                }
                if (t < 1f)
                {
                    return(-.5f * (a * Mathf.Pow(2f, 10f * (t -= 1f)) * Mathf.Sin((t * d - s) * (2f * Mathf.PI) / p)) + b);
                }
                return(a * Mathf.Pow(2f, -10f * (t -= 1f)) * Mathf.Sin((t * d - s) * (2f * Mathf.PI) / p) * .5f + c + b);
            }

            case TweenEasing.Linear:
            default:
            {
                return(c * t / d + b);
            }
            }
        }
        public void OnTransitionBegin(UIWindow window, UIWindow.VisualState state, bool instant)
        {
            if (!this.IsActive() || window == null)
            {
                return;
            }

            // Check if we are receiving hide event and we are not showing the overlay to begin with, return
            if (state == UIWindow.VisualState.Hidden && !this.IsVisible())
            {
                return;
            }

            // Prepare transition duration
            float       duration = (instant) ? 0f : window.transitionDuration;
            TweenEasing easing   = window.transitionEasing;

            // Showing a window
            if (state == UIWindow.VisualState.Shown)
            {
                // Increase the window count so we know when to hide the overlay
                this.m_WindowsCount += 1;

                // Check if the overlay is already visible
                if (this.IsVisible() && !this.m_Transitioning)
                {
                    // Bring the window forward
                    UIUtility.BringToFront(window.gameObject);

                    // Break
                    return;
                }

                // Bring the overlay forward
                UIUtility.BringToFront(this.gameObject);

                // Bring the window forward
                UIUtility.BringToFront(window.gameObject);

                // Transition
                this.StartAlphaTween(1f, duration, easing);

                // Toggle block raycast on
                this.m_CanvasGroup.blocksRaycasts = true;
            }
            // Hiding a window
            else
            {
                // Decrease the window count
                this.m_WindowsCount -= 1;

                // Never go below 0
                if (this.m_WindowsCount < 0)
                {
                    this.m_WindowsCount = 0;
                }

                // Check if we still have windows using the overlay
                if (this.m_WindowsCount > 0)
                {
                    return;
                }

                // Transition
                this.StartAlphaTween(0f, duration, easing);

                // Toggle block raycast on
                this.m_CanvasGroup.blocksRaycasts = false;
            }
        }
		/// <summary>
		/// Apply the specified easingType, t, b, c and d.
		/// </summary>
		/// <param name="e">Easing type.</param>
		/// <param name="t">Elapsed time.</param>
		/// <param name="b">Starting value.</param>
		/// <param name="c">Target value.</param>
		/// <param name="d">Duration.</param>
		public static float Apply(TweenEasing e, float t, float b, float c, float d)
		{
			switch (e)
			{
				case TweenEasing.Swing:
				{
					return -c *(t/=d)*(t-2f) + b;
				}
				case TweenEasing.InQuad:
				{
					return c*(t/=d)*t + b;
				}
				case TweenEasing.OutQuad:
				{
					return -c *(t/=d)*(t-2) + b;
				}
				case TweenEasing.InOutQuad:
				{
					if ((t/=d/2) < 1) return c/2*t*t + b;
					return -c/2 * ((--t)*(t-2) - 1) + b;
				}
				case TweenEasing.InCubic:
				{
					return c*(t/=d)*t*t + b;
				}
				case TweenEasing.OutCubic:
				{
					return c*((t=t/d-1)*t*t + 1) + b;
				}
				case TweenEasing.InOutCubic:
				{
					if ((t/=d/2) < 1) return c/2*t*t*t + b;
					return c/2*((t-=2)*t*t + 2) + b;
				}
				case TweenEasing.InQuart:
				{
					return c*(t/=d)*t*t*t + b;
				}
				case TweenEasing.OutQuart:
				{
					return -c * ((t=t/d-1)*t*t*t - 1) + b;
				}
				case TweenEasing.InOutQuart:
				{
					if ((t/=d/2) < 1) return c/2*t*t*t*t + b;
					return -c/2 * ((t-=2)*t*t*t - 2) + b;
				}
				case TweenEasing.InQuint:
				{
					return c*(t/=d)*t*t*t*t + b;
				}
				case TweenEasing.OutQuint:
				{
					return c*((t=t/d-1)*t*t*t*t + 1) + b;
				}
				case TweenEasing.InOutQuint:
				{
					if ((t/=d/2) < 1) return c/2*t*t*t*t*t + b;
					return c/2*((t-=2)*t*t*t*t + 2) + b;
				}
				case TweenEasing.InSine:
				{
					return -c * Mathf.Cos(t/d * (Mathf.PI/2)) + c + b;
				}
				case TweenEasing.OutSine:
				{
					return c * Mathf.Sin(t/d * (Mathf.PI/2)) + b;
				}
				case TweenEasing.InOutSine:
				{
					return -c/2 * (Mathf.Cos(Mathf.PI*t/d) - 1) + b;
				}
				case TweenEasing.InExpo:
				{
					return (t==0) ? b : c * Mathf.Pow(2, 10 * (t/d - 1)) + b;
				}
				case TweenEasing.OutExpo:
				{
					return (t==d) ? b+c : c * (-Mathf.Pow(2, -10 * t/d) + 1) + b;
				}
				case TweenEasing.InOutExpo:
				{
					if (t==0) return b;
					if (t==d) return b+c;
					if ((t/=d/2) < 1) return c/2 * Mathf.Pow(2, 10 * (t - 1)) + b;
					return c/2 * (-Mathf.Pow(2, -10 * --t) + 2) + b;
				}
				case TweenEasing.InCirc:
				{
					return -c * (Mathf.Sqrt(1 - (t/=d)*t) - 1) + b;
				}
				case TweenEasing.OutCirc:
				{
					return c * Mathf.Sqrt(1 - (t=t/d-1)*t) + b;
				}
				case TweenEasing.InOutCirc:
				{
					if ((t/=d/2) < 1) return -c/2 * (Mathf.Sqrt(1 - t*t) - 1) + b;
					return c/2 * (Mathf.Sqrt(1 - (t-=2)*t) + 1) + b;
				}
				case TweenEasing.InBack:
				{
					float s = 1.70158f;
					return c*(t/=d)*t*((s+1f)*t - s) + b;
				}
				case TweenEasing.OutBack:
				{
					float s = 1.70158f;
					return c*((t=t/d-1f)*t*((s+1f)*t + s) + 1f) + b;
				}
				case TweenEasing.InOutBack:
				{
					float s = 1.70158f;
					if ((t/=d/2f) < 1f) return c/2f*(t*t*(((s*=(1.525f))+1f)*t - s)) + b;
					return c/2f*((t-=2f)*t*(((s*=(1.525f))+1f)*t + s) + 2f) + b;
				}
				case TweenEasing.InBounce:
				{
					return c - TweenEasingHandler.Apply(TweenEasing.OutBounce, d-t, 0f, c, d) + b;
				}
				case TweenEasing.OutBounce:
				{
					if ((t/=d) < (1f/2.75f))
					{
						return c*(7.5625f*t*t) + b;
					}
					else if (t < (2f/2.75f))
					{
						return c*(7.5625f*(t-=(1.5f/2.75f))*t + .75f) + b;
					}
					else if (t < (2.5f/2.75f))
					{
						return c*(7.5625f*(t-=(2.25f/2.75f))*t + .9375f) + b;
					}
					else
					{
						return c*(7.5625f*(t-=(2.625f/2.75f))*t + .984375f) + b;
					}
				}
				case TweenEasing.InOutBounce:
				{
					if (t < d/2f) return TweenEasingHandler.Apply(TweenEasing.InBounce, t*2f, 0f, c, d) * .5f + b;
					return TweenEasingHandler.Apply(TweenEasing.OutBounce, t*2f-d, 0f, c, d) * .5f + c*.5f + b;
				}
				case TweenEasing.InElastic:
				{
					float s=1.70158f; float p=0f; float a=c;
					if (t==0f) return b;
					if ((t/=d)==1f) return b+c;
					if (p==0f) p=d*.3f;
					if (a < Mathf.Abs(c)) { a=c; s=p/4f; }
					else s = p/(2f*Mathf.PI) * Mathf.Asin(c/a);
					if (float.IsNaN(s)) s = 0f;
					return -(a*Mathf.Pow(2f,10f*(t-=1f)) * Mathf.Sin((t*d-s)*(2f*Mathf.PI)/p )) + b;
				}
				case TweenEasing.OutElastic:
				{
					float s=1.70158f; float p=0f; float a=c;
					if (t==0f) return b; if ((t/=d)==1f) return b+c; if (p==0f) p=d*.3f;
					if (a < Mathf.Abs(c)) { a=c; s=p/4f; }
					else s = p/(2f*Mathf.PI) * Mathf.Asin(c/a);
					if (float.IsNaN(s)) s = 0f;
					return a*Mathf.Pow(2f,-10f*t) * Mathf.Sin((t*d-s)*(2f*Mathf.PI)/p ) + c + b;
				}
				case TweenEasing.InOutElastic:
				{
					float s=1.70158f; float p=0f; float a=c;
					if (t==0f) return b; if ((t/=d/2f)==2f) return b+c; if (p==0f) p=d*(.3f*1.5f);
					if (a < Mathf.Abs(c)) { a=c; s=p/4f; }
					else s = p/(2f*Mathf.PI) * Mathf.Asin(c/a);
					if (float.IsNaN(s)) s = 0f;
					if (t < 1f) return -.5f*(a*Mathf.Pow(2f,10f*(t-=1f)) * Mathf.Sin((t*d-s)*(2f*Mathf.PI)/p )) + b;
					return a*Mathf.Pow(2f,-10f*(t-=1f)) * Mathf.Sin((t*d-s)*(2f*Mathf.PI)/p )*.5f + c + b;
				}
				case TweenEasing.Linear:
				default:
				{
					return c*t/d + b;
				}
			}
		}
Beispiel #7
0
 static IEnumerator LerpLocal(bool isUnscaled, Vector3 from, Vector3 to, float span, Action <Vector3> cbUpdate, Action cbFinish, TweenEasing easing)
 {
     if (span <= 0f)
     {
         cbUpdate(to);
     }
     else
     {
         var elapsed = 0f;
         var div     = 1f / span;
         while (true)
         {
             elapsed += isUnscaled ? Time.unscaledDeltaTime : Time.deltaTime;
             var t = Mathf.Min(1f, elapsed * div);
             var x = Tween.Apply(easing, elapsed, from.x, to.x - from.x, span);
             var y = Tween.Apply(easing, elapsed, from.y, to.y - from.y, span);
             var z = Tween.Apply(easing, elapsed, from.z, to.z - from.z, span);
             cbUpdate(new Vector3(x, y, z));
             if (1f <= t)
             {
                 break;
             }
             yield return(null);
         }
     }
     cbFinish.InvokeEx();
 }
Beispiel #8
0
 static IEnumerator LerpLocal(bool isUnscaled, float from, float to, float span, Func <float, bool> cbUpdate, Action cbFinish, TweenEasing easing)
 {
     if (span <= 0f)
     {
         cbUpdate(to);
     }
     else
     {
         var elapsed = 0f;
         var div     = 1f / span;
         while (true)
         {
             elapsed += isUnscaled ? Time.unscaledDeltaTime : Time.deltaTime;
             var t = Mathf.Min(1f, elapsed * div);
             var r = cbUpdate(Tween.Apply(easing, t, from, to - from, 1f));
             if (1f <= t || !r)
             {
                 break;
             }
             yield return(null);
         }
     }
     cbFinish.InvokeEx();
 }
Beispiel #9
0
 public static IEnumerator Lerp(Vector3 from, Vector3 to, float span, Action <Vector3> cbUpdate, Action cbFinish = null, TweenEasing easing = TweenEasing.Linear, bool unscaled = false)
 {
     yield return(LerpLocal(unscaled, from, to, span, cbUpdate, cbFinish, easing));
 }
Beispiel #10
0
 public static IEnumerator Lerp10(float span, Action <float> cbUpdate, Action cbFinish = null, TweenEasing easing = TweenEasing.Linear, bool unscaled = false)
 {
     yield return(LerpLocal(unscaled, 1, 0, span, cbUpdate, cbFinish, easing));
 }