示例#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)
     {
         if (t.specialStartupMode != 0 && !Tweener.DOStartupSpecials(t))
         {
             return(null);
         }
         if (snapStartValue)
         {
             if (DOTween.useSafeMode)
             {
                 try
                 {
                     t.startValue = t.tweenPlugin.ConvertToStartValue(t, t.getter());
                 }
                 catch
                 {
                     TweenManager.Despawn(t, true);
                     return(null);
                 }
             }
             else
             {
                 t.startValue = t.tweenPlugin.ConvertToStartValue(t, t.getter());
             }
         }
         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);
 }
示例#3
0
 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);
 }
示例#4
0
 internal static bool DoStartup <T1, T2, TPlugOptions>(TweenerCore <T1, T2, TPlugOptions> t) where TPlugOptions : struct
 {
     t.startupDone = true;
     if (t.specialStartupMode != 0 && !Tweener.DOStartupSpecials(t))
     {
         return(false);
     }
     if (!t.hasManuallySetStartValue)
     {
         if (DOTween.useSafeMode)
         {
             try
             {
                 t.startValue = t.tweenPlugin.ConvertToStartValue(t, t.getter());
             }
             catch
             {
                 return(false);
             }
         }
         else
         {
             t.startValue = t.tweenPlugin.ConvertToStartValue(t, t.getter());
         }
     }
     if (t.isRelative)
     {
         t.tweenPlugin.SetRelativeEndValue(t);
     }
     t.tweenPlugin.SetChangeValue(t);
     Tweener.DOStartupDurationBased(t);
     if (t.duration <= 0f)
     {
         t.easeType = Ease.INTERNAL_Zero;
     }
     return(true);
 }