mirror of
https://github.com/Cardidi/dotween-upm-fork.git
synced 2025-12-21 01:36:05 +08:00
Added advanced public ChangeStart/End/Values generic method directly to TweenerCore, that generates no allocs
This commit is contained in:
parent
444fff8aba
commit
98f2201364
@ -231,6 +231,32 @@
|
|||||||
Looks for the type within all possible project assembly names
|
Looks for the type within all possible project assembly names
|
||||||
</summary>
|
</summary>
|
||||||
</member>
|
</member>
|
||||||
|
<member name="M:DG.Tweening.Core.TweenerCore`3.ChangeStartValue(`1,System.Single)">
|
||||||
|
<summary>NO-GC METHOD: changes the start value of a tween and rewinds it (without pausing it).
|
||||||
|
Has no effect with tweens that are inside Sequences</summary>
|
||||||
|
<param name="newStartValue">The new start value</param>
|
||||||
|
<param name="newDuration">If bigger than 0 applies it as the new tween duration</param>
|
||||||
|
</member>
|
||||||
|
<member name="M:DG.Tweening.Core.TweenerCore`3.ChangeEndValue(`1,System.Boolean)">
|
||||||
|
<summary>NO-GC METHOD: changes the end value of a tween and rewinds it (without pausing it).
|
||||||
|
Has no effect with tweens that are inside Sequences</summary>
|
||||||
|
<param name="newEndValue">The new end value</param>
|
||||||
|
<param name="snapStartValue">If TRUE the start value will become the current target's value, otherwise it will stay the same</param>
|
||||||
|
</member>
|
||||||
|
<member name="M:DG.Tweening.Core.TweenerCore`3.ChangeEndValue(`1,System.Single,System.Boolean)">
|
||||||
|
<summary>NO-GC METHOD: changes the end value of a tween and rewinds it (without pausing it).
|
||||||
|
Has no effect with tweens that are inside Sequences</summary>
|
||||||
|
<param name="newEndValue">The new end value</param>
|
||||||
|
<param name="newDuration">If bigger than 0 applies it as the new tween duration</param>
|
||||||
|
<param name="snapStartValue">If TRUE the start value will become the current target's value, otherwise it will stay the same</param>
|
||||||
|
</member>
|
||||||
|
<member name="M:DG.Tweening.Core.TweenerCore`3.ChangeValues(`1,`1,System.Single)">
|
||||||
|
<summary>NO-GC METHOD: changes the start and end value of a tween and rewinds it (without pausing it).
|
||||||
|
Has no effect with tweens that are inside Sequences</summary>
|
||||||
|
<param name="newStartValue">The new start value</param>
|
||||||
|
<param name="newEndValue">The new end value</param>
|
||||||
|
<param name="newDuration">If bigger than 0 applies it as the new tween duration</param>
|
||||||
|
</member>
|
||||||
<member name="T:DG.Tweening.Color2">
|
<member name="T:DG.Tweening.Color2">
|
||||||
<summary>
|
<summary>
|
||||||
Struct that stores two colors (used for LineRenderer tweens)
|
Struct that stores two colors (used for LineRenderer tweens)
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -111,6 +111,57 @@ namespace DG.Tweening.Core
|
|||||||
return DoChangeValues(this, (T2)newStartValue, (T2)newEndValue, newDuration);
|
return DoChangeValues(this, (T2)newStartValue, (T2)newEndValue, newDuration);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#region Advanced Usage (direct from TweenerCore reference)
|
||||||
|
|
||||||
|
/// <summary>NO-GC METHOD: changes the start value of a tween and rewinds it (without pausing it).
|
||||||
|
/// Has no effect with tweens that are inside Sequences</summary>
|
||||||
|
/// <param name="newStartValue">The new start value</param>
|
||||||
|
/// <param name="newDuration">If bigger than 0 applies it as the new tween duration</param>
|
||||||
|
public TweenerCore<T1,T2,TPlugOptions> ChangeStartValue(T2 newStartValue, float newDuration = -1)
|
||||||
|
{
|
||||||
|
if (isSequenced) {
|
||||||
|
if (Debugger.logPriority >= 1) Debugger.LogWarning(_TxtCantChangeSequencedValues);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
return DoChangeStartValue(this, newStartValue, newDuration);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>NO-GC METHOD: changes the end value of a tween and rewinds it (without pausing it).
|
||||||
|
/// Has no effect with tweens that are inside Sequences</summary>
|
||||||
|
/// <param name="newEndValue">The new end value</param>
|
||||||
|
/// <param name="snapStartValue">If TRUE the start value will become the current target's value, otherwise it will stay the same</param>
|
||||||
|
public TweenerCore<T1,T2,TPlugOptions> ChangeEndValue(T2 newEndValue, bool snapStartValue)
|
||||||
|
{ return ChangeEndValue(newEndValue, -1, snapStartValue); }
|
||||||
|
/// <summary>NO-GC METHOD: changes the end value of a tween and rewinds it (without pausing it).
|
||||||
|
/// Has no effect with tweens that are inside Sequences</summary>
|
||||||
|
/// <param name="newEndValue">The new end value</param>
|
||||||
|
/// <param name="newDuration">If bigger than 0 applies it as the new tween duration</param>
|
||||||
|
/// <param name="snapStartValue">If TRUE the start value will become the current target's value, otherwise it will stay the same</param>
|
||||||
|
public TweenerCore<T1,T2,TPlugOptions> ChangeEndValue(T2 newEndValue, float newDuration = -1, bool snapStartValue = false)
|
||||||
|
{
|
||||||
|
if (isSequenced) {
|
||||||
|
if (Debugger.logPriority >= 1) Debugger.LogWarning(_TxtCantChangeSequencedValues);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
return DoChangeEndValue(this, newEndValue, newDuration, snapStartValue);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>NO-GC METHOD: changes the start and end value of a tween and rewinds it (without pausing it).
|
||||||
|
/// Has no effect with tweens that are inside Sequences</summary>
|
||||||
|
/// <param name="newStartValue">The new start value</param>
|
||||||
|
/// <param name="newEndValue">The new end value</param>
|
||||||
|
/// <param name="newDuration">If bigger than 0 applies it as the new tween duration</param>
|
||||||
|
public TweenerCore<T1,T2,TPlugOptions> ChangeValues(T2 newStartValue, T2 newEndValue, float newDuration = -1)
|
||||||
|
{
|
||||||
|
if (isSequenced) {
|
||||||
|
if (Debugger.logPriority >= 1) Debugger.LogWarning(_TxtCantChangeSequencedValues);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
return DoChangeValues(this, newStartValue, newEndValue, newDuration);
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
// Sets From tweens, immediately sending the target to its endValue and assigning new start/endValues.
|
// Sets From tweens, immediately sending the target to its endValue and assigning new start/endValues.
|
||||||
|
|||||||
@ -32,7 +32,7 @@ namespace DG.Tweening
|
|||||||
public class DOTween
|
public class DOTween
|
||||||
{
|
{
|
||||||
/// <summary>DOTween's version</summary>
|
/// <summary>DOTween's version</summary>
|
||||||
public static readonly string Version = "1.2.230"; // Last version before modules: 1.1.755
|
public static readonly string Version = "1.2.235"; // Last version before modules: 1.1.755
|
||||||
|
|
||||||
///////////////////////////////////////////////
|
///////////////////////////////////////////////
|
||||||
// Options ////////////////////////////////////
|
// Options ////////////////////////////////////
|
||||||
|
|||||||
@ -158,7 +158,7 @@ namespace DG.Tweening
|
|||||||
}
|
}
|
||||||
|
|
||||||
// CALLED BY TweenerCore
|
// CALLED BY TweenerCore
|
||||||
internal static Tweener DoChangeStartValue<T1, T2, TPlugOptions>(
|
internal static TweenerCore<T1, T2, TPlugOptions> DoChangeStartValue<T1, T2, TPlugOptions>(
|
||||||
TweenerCore<T1, T2, TPlugOptions> t, T2 newStartValue, float newDuration
|
TweenerCore<T1, T2, TPlugOptions> t, T2 newStartValue, float newDuration
|
||||||
) where TPlugOptions : struct, IPlugOptions
|
) where TPlugOptions : struct, IPlugOptions
|
||||||
{
|
{
|
||||||
@ -184,7 +184,7 @@ namespace DG.Tweening
|
|||||||
}
|
}
|
||||||
|
|
||||||
// CALLED BY TweenerCore
|
// CALLED BY TweenerCore
|
||||||
internal static Tweener DoChangeEndValue<T1, T2, TPlugOptions>(
|
internal static TweenerCore<T1, T2, TPlugOptions> DoChangeEndValue<T1, T2, TPlugOptions>(
|
||||||
TweenerCore<T1, T2, TPlugOptions> t, T2 newEndValue, float newDuration, bool snapStartValue
|
TweenerCore<T1, T2, TPlugOptions> t, T2 newEndValue, float newDuration, bool snapStartValue
|
||||||
) where TPlugOptions : struct, IPlugOptions
|
) where TPlugOptions : struct, IPlugOptions
|
||||||
{
|
{
|
||||||
@ -221,7 +221,7 @@ namespace DG.Tweening
|
|||||||
return t;
|
return t;
|
||||||
}
|
}
|
||||||
|
|
||||||
internal static Tweener DoChangeValues<T1, T2, TPlugOptions>(
|
internal static TweenerCore<T1, T2, TPlugOptions> DoChangeValues<T1, T2, TPlugOptions>(
|
||||||
TweenerCore<T1, T2, TPlugOptions> t, T2 newStartValue, T2 newEndValue, float newDuration
|
TweenerCore<T1, T2, TPlugOptions> t, T2 newStartValue, T2 newEndValue, float newDuration
|
||||||
) where TPlugOptions : struct, IPlugOptions
|
) where TPlugOptions : struct, IPlugOptions
|
||||||
{
|
{
|
||||||
|
|||||||
@ -231,6 +231,32 @@
|
|||||||
Looks for the type within all possible project assembly names
|
Looks for the type within all possible project assembly names
|
||||||
</summary>
|
</summary>
|
||||||
</member>
|
</member>
|
||||||
|
<member name="M:DG.Tweening.Core.TweenerCore`3.ChangeStartValue(`1,System.Single)">
|
||||||
|
<summary>NO-GC METHOD: changes the start value of a tween and rewinds it (without pausing it).
|
||||||
|
Has no effect with tweens that are inside Sequences</summary>
|
||||||
|
<param name="newStartValue">The new start value</param>
|
||||||
|
<param name="newDuration">If bigger than 0 applies it as the new tween duration</param>
|
||||||
|
</member>
|
||||||
|
<member name="M:DG.Tweening.Core.TweenerCore`3.ChangeEndValue(`1,System.Boolean)">
|
||||||
|
<summary>NO-GC METHOD: changes the end value of a tween and rewinds it (without pausing it).
|
||||||
|
Has no effect with tweens that are inside Sequences</summary>
|
||||||
|
<param name="newEndValue">The new end value</param>
|
||||||
|
<param name="snapStartValue">If TRUE the start value will become the current target's value, otherwise it will stay the same</param>
|
||||||
|
</member>
|
||||||
|
<member name="M:DG.Tweening.Core.TweenerCore`3.ChangeEndValue(`1,System.Single,System.Boolean)">
|
||||||
|
<summary>NO-GC METHOD: changes the end value of a tween and rewinds it (without pausing it).
|
||||||
|
Has no effect with tweens that are inside Sequences</summary>
|
||||||
|
<param name="newEndValue">The new end value</param>
|
||||||
|
<param name="newDuration">If bigger than 0 applies it as the new tween duration</param>
|
||||||
|
<param name="snapStartValue">If TRUE the start value will become the current target's value, otherwise it will stay the same</param>
|
||||||
|
</member>
|
||||||
|
<member name="M:DG.Tweening.Core.TweenerCore`3.ChangeValues(`1,`1,System.Single)">
|
||||||
|
<summary>NO-GC METHOD: changes the start and end value of a tween and rewinds it (without pausing it).
|
||||||
|
Has no effect with tweens that are inside Sequences</summary>
|
||||||
|
<param name="newStartValue">The new start value</param>
|
||||||
|
<param name="newEndValue">The new end value</param>
|
||||||
|
<param name="newDuration">If bigger than 0 applies it as the new tween duration</param>
|
||||||
|
</member>
|
||||||
<member name="T:DG.Tweening.Color2">
|
<member name="T:DG.Tweening.Color2">
|
||||||
<summary>
|
<summary>
|
||||||
Struct that stores two colors (used for LineRenderer tweens)
|
Struct that stores two colors (used for LineRenderer tweens)
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user