Skip to content

Commit d80ca1d

Browse files
committed
Improve code clarity
1 parent c21b1c6 commit d80ca1d

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

Sources/GateEngine/ECS/3D Specific/Rig/Rig3DComponent.swift

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,15 @@
7575
}
7676

7777
public var animationIsFinished: Bool {
78-
guard skeleton.isReady && activeAnimation?.isReady == true else {return false}
79-
return activeAnimation?.isFinished ?? true
78+
guard skeleton.isReady else {return false}
79+
if let activeAnimation {
80+
if activeAnimation.isReady == false {
81+
return false
82+
}
83+
return activeAnimation.isFinished
84+
}
85+
// When no animation is active, always be finished
86+
return true
8087
}
8188

8289
public var animationRepeats: Bool {

0 commit comments

Comments
 (0)