fix: reset time button does not work correctly in the inspector when UIEffectTweener.direction=Reverse in the editor

close #310
This commit is contained in:
mob-sakai
2025-02-28 17:37:37 +09:00
parent 3f5a7dcd2d
commit 8513970e6f
+9 -1
View File
@@ -77,7 +77,7 @@ namespace Coffee.UIEffects.Editors
var rResetTimeButton = new Rect(r.x, r.y, 20, r.height);
if (GUI.Button(rResetTimeButton, EditorGUIUtility.IconContent("animation.firstkey"), "IconButton"))
{
SetTime(0);
ResetTime();
}
var rPlayButton = new Rect(r.x + 20, r.y, 20, r.height);
@@ -149,6 +149,14 @@ namespace Coffee.UIEffects.Editors
}
}
private void ResetTime()
{
foreach (var tweener in targets.OfType<UIEffectTweener>())
{
tweener.ResetTime(tweener.direction);
}
}
private void SetPlaying(bool enable)
{
if (!EditorApplication.isPlaying)