From 0d39d50968baa9835eef3b0ca60a0a84807b342a Mon Sep 17 00:00:00 2001 From: 17146 <1714673995@qq.com> Date: Thu, 20 Mar 2025 17:15:31 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=8A=A8=E7=94=BB=E8=AE=A1?= =?UTF-8?q?=E6=97=B6=E5=99=A8=E9=BB=98=E8=AE=A4=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../superbwarfare/tools/animation/AnimationTimer.java | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/atsuishio/superbwarfare/tools/animation/AnimationTimer.java b/src/main/java/com/atsuishio/superbwarfare/tools/animation/AnimationTimer.java index 94f112070..17ed16cbc 100644 --- a/src/main/java/com/atsuishio/superbwarfare/tools/animation/AnimationTimer.java +++ b/src/main/java/com/atsuishio/superbwarfare/tools/animation/AnimationTimer.java @@ -8,11 +8,12 @@ import java.util.function.Function; * 可以更改计时方向的动画计时器 */ public class AnimationTimer { + private final long duration; private long startTime; private boolean reversed; private boolean initialized; - private boolean isStart = true; + private boolean isStart; private Function forwardAnimationCurve = AnimationCurves.LINEAR; private Function backwardAnimationCurve = AnimationCurves.LINEAR; @@ -44,7 +45,6 @@ public class AnimationTimer { /** * 设置反向计时时采用的动画曲线 */ - public AnimationTimer backwardAnimation(Function animationCurve) { this.backwardAnimationCurve = animationCurve; return this; @@ -56,7 +56,6 @@ public class AnimationTimer { * @param size 计时器数量 * @param duration 动画持续时间,单位为毫秒 */ - public static AnimationTimer[] createTimers(int size, long duration) { return createTimers(size, duration, AnimationCurves.LINEAR); } @@ -97,7 +96,6 @@ public class AnimationTimer { return !reversed; } - /** * 获取当前进度 * @@ -160,7 +158,6 @@ public class AnimationTimer { /** * 开始正向计时 */ - public void beginForward(long currentTime) { begin(); forward(currentTime); @@ -206,5 +203,4 @@ public class AnimationTimer { public float lerp(float start, float end, long currentTime) { return Mth.lerp(getProgress(currentTime), start, end); } - }