Merge pull request #352 from thecodingmachine/fixloadingsametexture
Fixing loading of same custom texture several time
This commit is contained in:
commit
7550d3ea38
@ -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,
|
||||||
|
Loading…
Reference in New Issue
Block a user