瀏覽代碼

[haxe] Port of commit c2fe1a3, Added TrackEntry IsNextReady. See #2547.

Davide Tantillo 1 年之前
父節點
當前提交
0e9a004388
共有 1 個文件被更改,包括 7 次插入1 次删除
  1. 7 1
      spine-haxe/spine-haxe/spine/animation/TrackEntry.hx

+ 7 - 1
spine-haxe/spine-haxe/spine/animation/TrackEntry.hx

@@ -112,10 +112,16 @@ class TrackEntry implements Poolable {
 	/** Returns true if this track entry has been applied at least once.
 	/** Returns true if this track entry has been applied at least once.
 	 * <p>
 	 * <p>
 	 * See {@link AnimationState#apply(Skeleton)}. */
 	 * See {@link AnimationState#apply(Skeleton)}. */
-	 public function wasApplied () {
+	public function wasApplied() {
 		return nextTrackLast != -1;
 		return nextTrackLast != -1;
 	}
 	}
 
 
+	/** Returns true if there is a {@link #getNext()} track entry and it will become the current track entry during the next
+	* {@link AnimationState#update(float)}. */
+	public function isNextReady():Bool {
+		return next != null && nextTrackLast - next.delay >= 0;
+	}
+
 	public function reset():Void {
 	public function reset():Void {
 		next = null;
 		next = null;
 		previous = null;
 		previous = null;