mirror of
https://github.com/Cardidi/dotween-upm-fork.git
synced 2025-12-21 01:36:05 +08:00
[BUGFIX] Fixed bug with ElapsedPercentage returning NaN if the tween was never played
This commit is contained in:
parent
0d0eea2ead
commit
af8fd4db95
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -15,14 +15,11 @@ public class TempTests : BrainBase
|
||||
|
||||
IEnumerator Start()
|
||||
{
|
||||
Tween t = target.DOMoveX(2, 4).Pause();
|
||||
yield return new WaitForSeconds(1);
|
||||
|
||||
Sequence s = DOTween.Sequence()
|
||||
.OnStart(() => Debug.Log("START"))
|
||||
.Append(target.DOMoveX(2, 1).OnStart(() => Debug.Log("Append X")))
|
||||
.SetDelay(1)
|
||||
.Join(target.DOMoveY(2, 1).OnStart(() => Debug.Log("Join y")))
|
||||
.SetDelay(2)
|
||||
.OnComplete(()=> Debug.Log("COMPLETE"));
|
||||
Debug.Log(t.Duration());
|
||||
Debug.Log(t.ElapsedPercentage());
|
||||
|
||||
}
|
||||
}
|
||||
@ -32,7 +32,7 @@ namespace DG.Tweening
|
||||
public class DOTween
|
||||
{
|
||||
/// <summary>DOTween's version</summary>
|
||||
public static readonly string Version = "1.1.747";
|
||||
public static readonly string Version = "1.1.750";
|
||||
|
||||
///////////////////////////////////////////////
|
||||
// Options ////////////////////////////////////
|
||||
|
||||
@ -460,6 +460,7 @@ namespace DG.Tweening
|
||||
}
|
||||
|
||||
if (includeLoops) {
|
||||
if (t.fullDuration <= 0) return 0;
|
||||
int loopsToCount = t.position >= t.duration ? t.completedLoops - 1 : t.completedLoops;
|
||||
return ((loopsToCount * t.duration) + t.position) / t.fullDuration;
|
||||
}
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
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