fix: PlayOnEnable.Reverse in UIEffectTweener does not work

close #310
This commit is contained in:
mob-sakai
2025-02-27 18:41:37 +09:00
parent a748adf1bd
commit 3f5a7dcd2d
+15 -3
View File
@@ -345,7 +345,7 @@ namespace Coffee.UIEffects
{ {
if (resetTime) if (resetTime)
{ {
ResetTime(); ResetTime(direction);
} }
Play(); Play();
@@ -365,7 +365,7 @@ namespace Coffee.UIEffects
{ {
if (resetTime) if (resetTime)
{ {
ResetTime(); ResetTime(Direction.Forward);
} }
PlayForward(); PlayForward();
@@ -386,7 +386,7 @@ namespace Coffee.UIEffects
{ {
if (resetTime) if (resetTime)
{ {
ResetTime(); ResetTime(Direction.Reverse);
} }
PlayReverse(); PlayReverse();
@@ -419,6 +419,18 @@ namespace Coffee.UIEffects
SetTime(0); SetTime(0);
} }
public void ResetTime(Direction dir)
{
if (dir == Direction.Forward)
{
SetTime(0);
}
else
{
SetTime(totalTime - 0.0001f);
}
}
[Obsolete( [Obsolete(
"UIEffectTweener.Restart has been deprecated. Use UIEffectTweener.ResetTime instead (UnityUpgradable) -> ResetTime")] "UIEffectTweener.Restart has been deprecated. Use UIEffectTweener.ResetTime instead (UnityUpgradable) -> ResetTime")]
public void Restart() public void Restart()