Fixing loading of same custom texture several time
Phaser 3 does not trigger oncomplete event if the resource is already loaded.
This commit is contained in:
parent
c03dd4c551
commit
45c6e13cad
@ -1266,6 +1266,10 @@ export class GameScene extends ResizableScene implements CenterListener {
|
||||
|
||||
private loadSpritesheet(name: string, url: string): Promise<void> {
|
||||
return new Promise<void>(((resolve, reject) => {
|
||||
if (this.textures.exists(name)) {
|
||||
resolve();
|
||||
return;
|
||||
}
|
||||
this.load.spritesheet(
|
||||
name,
|
||||
url,
|
||||
|
Loading…
Reference in New Issue
Block a user