瀏覽代碼

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

Davide Tantillo 1 年之前
父節點
當前提交
2ac0307c84
共有 1 個文件被更改,包括 6 次插入0 次删除
  1. 6 0
      spine-ts/spine-core/src/AnimationState.ts

+ 6 - 0
spine-ts/spine-core/src/AnimationState.ts

@@ -1032,6 +1032,12 @@ export class TrackEntry {
 	wasApplied () {
 		return this.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)}. */
+	isNextReady () {
+		return this.next != null && this.nextTrackLast - this.next.delay >= 0;
+	}
 }
 
 export class EventQueue {