mirror of
https://github.com/Cardidi/dotween-upm-fork.git
synced 2025-12-20 01:06:02 +08:00
[BUGFIX] Fixed bug where calling PlayForward immediately after a PlayBackwards in the same frame gave unexpected results if the tween was already complete
This commit is contained in:
parent
017c577f06
commit
576460f6e9
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -11,20 +11,16 @@ using UnityEngine.UI;
|
||||
|
||||
public class TempTests : BrainBase
|
||||
{
|
||||
public bool useFrom = true;
|
||||
public Transform target;
|
||||
|
||||
IEnumerator Start()
|
||||
{
|
||||
if (!useFrom) {
|
||||
target.DOMoveX(2, 2);
|
||||
} else {
|
||||
Vector3 currentPosition = target.position;
|
||||
target.DOMoveX(2, 2).From().SetAutoKill(false);//.OnRewind(() => OnResetTransformFrom(transformToAnimate,currentPosition));
|
||||
}
|
||||
Sequence s = DOTween.Sequence().SetAutoKill(false)
|
||||
.Join(target.DOMoveX(2, 1))
|
||||
.Append(target.DOMoveY(2, 1));
|
||||
yield return s.WaitForCompletion(true);
|
||||
|
||||
yield return new WaitForSeconds(3f);
|
||||
|
||||
target.DORewind();
|
||||
s.PlayBackwards();
|
||||
s.PlayForward();
|
||||
}
|
||||
}
|
||||
Binary file not shown.
@ -738,6 +738,9 @@ namespace DG.Tweening.Core
|
||||
if (t.completedLoops == 0 && t.position <= 0) {
|
||||
// Already rewinded, manage OnRewind callback
|
||||
ManageOnRewindCallbackWhenAlreadyRewinded(t, true);
|
||||
t.isBackwards = true;
|
||||
t.isPlaying = false;
|
||||
return false;
|
||||
}
|
||||
if (!t.isBackwards) {
|
||||
t.isBackwards = true;
|
||||
@ -749,6 +752,11 @@ namespace DG.Tweening.Core
|
||||
|
||||
internal static bool PlayForward(Tween t)
|
||||
{
|
||||
if (t.isComplete) {
|
||||
t.isBackwards = false;
|
||||
t.isPlaying = false;
|
||||
return false;
|
||||
}
|
||||
if (t.isBackwards) {
|
||||
t.isBackwards = false;
|
||||
Play(t);
|
||||
|
||||
@ -34,7 +34,7 @@ namespace DG.Tweening
|
||||
public class DOTween
|
||||
{
|
||||
/// <summary>DOTween's version</summary>
|
||||
public static readonly string Version = "1.2.250"; // Last version before modules: 1.1.755
|
||||
public static readonly string Version = "1.2.251"; // Last version before modules: 1.1.755
|
||||
|
||||
///////////////////////////////////////////////
|
||||
// Options ////////////////////////////////////
|
||||
|
||||
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