IEnumerator InterpolProc(float time, Action onInterpolationComplate, Interpolations.eInterpolation interpolation, IInterpolatorBase interolatorCore)
        {
            CoroutineInterpolatorInternal interpolator = _coroutineInterpolatorInternal = new CoroutineInterpolatorInternal(onInterpolationComplate, interpolation, interolatorCore);

            interpolator.Init(time);

            while (interpolator.IsActive())
            {
                if (_timeType != eTime.TIME_FIXED)
                {
                    yield return(new WaitForEndOfFrame());
                }
                else
                {
                    yield return(new WaitForFixedUpdate());
                }

                if (_coroutineInterpolatorInternal != interpolator)
                {
                    yield break;
                }

                float time_ = 0.0f;
                switch (_timeType)
                {
                case eTime.TIME_SCALED:
                    time_ = Time.deltaTime;
                    break;

                case eTime.TIME_UNSCALED:
                    time_ = Time.unscaledDeltaTime;
                    break;

                case eTime.TIME_FIXED:
                    time_ = Time.fixedDeltaTime;
                    break;

                default:
                    time_ = 0.0f;
                    break;
                }

                interpolator.Update(time_ * _timeScale);
            }
        }
        static IEnumerator InterpolProcUnmanaged(float time, Action onInterpolationComplate, Interpolations.eInterpolation interpolation, IInterpolatorBase interolatorCore)
        {
            CoroutineInterpolatorInternal interpolator = new CoroutineInterpolatorInternal(onInterpolationComplate, interpolation, interolatorCore);

            interpolator.Init(time);

            while (interpolator.IsActive())
            {
                yield return(new WaitForEndOfFrame());

                interpolator.Update(Time.deltaTime);
            }
        }
 public Coroutine Interpolate(Color startValue, Color complateValue, float time, Action <Color> onInterpolationProc, Action onInterpolationComplate = null, Interpolations.eInterpolation interpolation = Interpolations.eInterpolation.INTERPOLATE_TYPE_LINEAR)
 {
     return(_monoBehaviour.StartCoroutine(InterpolProc(time, onInterpolationComplate, interpolation, new InterpolatorColor(startValue, complateValue, onInterpolationProc))));
 }
 public CoroutineInterpolatorInternal(Action onInterpolationComplate, Interpolations.eInterpolation interpolation, IInterpolatorBase interolatorCore)
 {
     _interpolation           = interpolation;
     _onInterpolationComplate = onInterpolationComplate;
     _interpolatorCore        = interolatorCore;
 }
 public static Coroutine InterpolateUnmanaged(MonoBehaviour monoBehaviour, Vector4 startValue, Vector4 complateValue, float time, Action <Vector4> onInterpolationProc, Action onInterpolationComplate = null, Interpolations.eInterpolation interpolation = Interpolations.eInterpolation.INTERPOLATE_TYPE_LINEAR)
 {
     return(monoBehaviour.StartCoroutine(InterpolProcUnmanaged(time, onInterpolationComplate, interpolation, new InterpolatorVector4(startValue, complateValue, onInterpolationProc))));
 }