Merge pull request #352 from thecodingmachine/fixloadingsametexture

Fixing loading of same custom texture several time
This commit is contained in:
David Négrier 2020-10-21 12:20:22 +02:00 committed by GitHub
commit 7550d3ea38
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1266,6 +1266,10 @@ export class GameScene extends ResizableScene implements CenterListener {
private loadSpritesheet(name: string, url: string): Promise<void> { private loadSpritesheet(name: string, url: string): Promise<void> {
return new Promise<void>(((resolve, reject) => { return new Promise<void>(((resolve, reject) => {
if (this.textures.exists(name)) {
resolve();
return;
}
this.load.spritesheet( this.load.spritesheet(
name, name,
url, url,