From 06dd5148d39ebc156b3e2feef7660ca1de442161 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E6=80=9D=E6=B5=B7?= <1464576565@qq.com> Date: Fri, 14 Mar 2025 17:37:57 +0800 Subject: [PATCH] modify --- Runtime/Core/Animation/CanvasGroupAlphaTo.cs | 10 ++++++++-- Runtime/Core/Animation/GraphicColorTo.cs | 10 +++++++--- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/Runtime/Core/Animation/CanvasGroupAlphaTo.cs b/Runtime/Core/Animation/CanvasGroupAlphaTo.cs index b745e28..991e812 100644 --- a/Runtime/Core/Animation/CanvasGroupAlphaTo.cs +++ b/Runtime/Core/Animation/CanvasGroupAlphaTo.cs @@ -22,12 +22,18 @@ namespace AlicizaX.AnimationFlow.Runtime { { target.alpha = orgValue; } - + public override void OnEnter() { if (setFrom) { target.alpha = from; } + + if (Condition()) + { + target.alpha = to; + } enterValue = target.alpha; + } public override void OnUpdate(float dt) { @@ -35,7 +41,7 @@ namespace AlicizaX.AnimationFlow.Runtime { } public override bool Valid() { - return target != null && duration > 0; + return target != null; } public override float Duration() { diff --git a/Runtime/Core/Animation/GraphicColorTo.cs b/Runtime/Core/Animation/GraphicColorTo.cs index 33ebf1b..aa46991 100644 --- a/Runtime/Core/Animation/GraphicColorTo.cs +++ b/Runtime/Core/Animation/GraphicColorTo.cs @@ -20,7 +20,7 @@ namespace AlicizaX.AnimationFlow.Runtime { orgValue = target.color; } - + public override void OnReset() { target.color = orgValue; @@ -33,6 +33,10 @@ namespace AlicizaX.AnimationFlow.Runtime target.color = from; } + if (Condition()) + { + target.color = to; + } enterValue = target.color; } @@ -43,7 +47,7 @@ namespace AlicizaX.AnimationFlow.Runtime public override bool Valid() { - return target != null && duration > 0; + return target != null; } public override float Duration() @@ -61,4 +65,4 @@ namespace AlicizaX.AnimationFlow.Runtime return target != null ? target.name : null; } } -} \ No newline at end of file +}