예제 #1
0
 internal static Tweener DoChangeValues <T1, T2, TPlugOptions>(TweenerCore <T1, T2, TPlugOptions> t, T2 newStartValue, T2 newEndValue, float newDuration) where TPlugOptions : struct
 {
     t.hasManuallySetStartValue = true;
     t.isRelative = (t.isFrom = false);
     t.startValue = newStartValue;
     t.endValue   = newEndValue;
     if (t.startupDone)
     {
         if (t.specialStartupMode != 0 && !Tweener.DOStartupSpecials(t))
         {
             return(null);
         }
         t.tweenPlugin.SetChangeValue(t);
     }
     if (newDuration > 0f)
     {
         t.duration = newDuration;
         if (t.startupDone)
         {
             Tweener.DOStartupDurationBased(t);
         }
     }
     Tween.DoGoto(t, 0f, 0, UpdateMode.IgnoreOnUpdate);
     return(t);
 }
예제 #2
0
        internal static Tweener DoChangeEndValue <T1, T2, TPlugOptions>(TweenerCore <T1, T2, TPlugOptions> t, T2 newEndValue, float newDuration, bool snapStartValue) where TPlugOptions : struct
        {
            t.endValue   = newEndValue;
            t.isRelative = false;
            if (!t.startupDone)
            {
                goto Label_0086;
            }
            if ((t.specialStartupMode != SpecialStartupMode.None) && !DOStartupSpecials <T1, T2, TPlugOptions>(t))
            {
                return(null);
            }
            if (snapStartValue)
            {
                if (DOTween.useSafeMode)
                {
                    try
                    {
                        t.startValue = t.tweenPlugin.ConvertToStartValue(t, t.getter());
                        goto Label_007A;
                    }
                    catch
                    {
                        TweenManager.Despawn(t, true);
                        return(null);
                    }
                }
                t.startValue = t.tweenPlugin.ConvertToStartValue(t, t.getter());
            }
Label_007A:
            t.tweenPlugin.SetChangeValue(t);
Label_0086:
            if (newDuration > 0f)
            {
                t.duration = newDuration;
                if (t.startupDone)
                {
                    DOStartupDurationBased <T1, T2, TPlugOptions>(t);
                }
            }
            Tween.DoGoto(t, 0f, 0, UpdateMode.IgnoreOnUpdate);
            return(t);
        }
예제 #3
0
파일: Tweener.cs 프로젝트: garsonlab/GCube
 public static Tweener DoChangeStartValue <T1, T2, TPlugOptions>(TweenerCore <T1, T2, TPlugOptions> t, T2 newStartValue, float newDuration) where TPlugOptions : struct
 {
     t.hasManuallySetStartValue = true;
     t.startValue = newStartValue;
     if (t.startupDone)
     {
         if (t.specialStartupMode != SpecialStartupMode.None && !Tweener.DOStartupSpecials <T1, T2, TPlugOptions>(t))
         {
             return(null);
         }
         t.tweenPlugin.SetChangeValue(t);
     }
     if (newDuration > 0f)
     {
         t.duration = newDuration;
         if (t.startupDone)
         {
             Tweener.DOStartupDurationBased <T1, T2, TPlugOptions>(t);
         }
     }
     Tween.DoGoto(t, 0f, 0, UpdateMode.IgnoreOnUpdate);
     return(t);
 }