Skip to content

Commit f93c563

Browse files
committed
[ts][player] Prevent loading callback to be called indefinitely.
1 parent 198f816 commit f93c563

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

spine-ts/spine-player/src/Player.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -817,8 +817,8 @@ export class SpinePlayer implements Disposable {
817817
let delta = this.time.delta;
818818

819819
// Load the skeleton if the assets are ready.
820-
let loading = this.assetManager!.isLoadingComplete();
821-
if (!this.skeleton && loading) this.loadSkeleton();
820+
let loading = !this.assetManager!.isLoadingComplete();
821+
if (!this.skeleton && !loading) this.loadSkeleton();
822822
let skeleton = this.skeleton!;
823823
let config = this.config!;
824824
if (skeleton) {
@@ -940,7 +940,7 @@ export class SpinePlayer implements Disposable {
940940
// Draw the loading screen.
941941
if (config.showLoading) {
942942
this.loadingScreen!.backgroundColor.setFromColor(bg);
943-
this.loadingScreen!.draw(loading);
943+
this.loadingScreen!.draw(!loading);
944944
}
945945
if (loading && config.loading) config.loading(this, delta);
946946
} catch (e) {

0 commit comments

Comments
 (0)