Browse Source

[libgdx] Added TrackEntry#isNextReady().

closes #2540
Nathan Sweet 1 year ago
parent
commit
c2fe1a3d77

+ 6 - 0
spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/AnimationState.java

@@ -1156,6 +1156,12 @@ public class AnimationState {
 			return nextTrackLast != -1;
 		}
 
+		/** Returns true if there is a {@link #getNext()} track entry that is ready to become the current track entry during the
+		 * next {@link AnimationState#update(float)}. */
+		public boolean isNextReady () {
+			return next != null && nextTrackLast - next.delay >= 0;
+		}
+
 		/** Returns true if at least one loop has been completed.
 		 * <p>
 		 * See {@link AnimationStateListener#complete(TrackEntry)}. */