Skip to content

Commit

Permalink
[ts][player] Prevent loading callback to be called indefinitely.
Browse files Browse the repository at this point in the history
  • Loading branch information
davidetan committed Jul 4, 2024
1 parent 198f816 commit f93c563
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions spine-ts/spine-player/src/Player.ts
Original file line number Diff line number Diff line change
Expand Up @@ -817,8 +817,8 @@ export class SpinePlayer implements Disposable {
let delta = this.time.delta;

// Load the skeleton if the assets are ready.
let loading = this.assetManager!.isLoadingComplete();
if (!this.skeleton && loading) this.loadSkeleton();
let loading = !this.assetManager!.isLoadingComplete();
if (!this.skeleton && !loading) this.loadSkeleton();
let skeleton = this.skeleton!;
let config = this.config!;
if (skeleton) {
Expand Down Expand Up @@ -940,7 +940,7 @@ export class SpinePlayer implements Disposable {
// Draw the loading screen.
if (config.showLoading) {
this.loadingScreen!.backgroundColor.setFromColor(bg);
this.loadingScreen!.draw(loading);
this.loadingScreen!.draw(!loading);
}
if (loading && config.loading) config.loading(this, delta);
} catch (e) {
Expand Down

0 comments on commit f93c563

Please sign in to comment.