don't fail if companion texture is not found
This commit is contained in:
parent
c07079051a
commit
fc3a503bcf
2 changed files with 16 additions and 14 deletions
|
@ -36,10 +36,12 @@ export class Companion extends Container {
|
|||
|
||||
this.companionName = name;
|
||||
|
||||
lazyLoadResource(this.scene.load, this.companionName).then(resource => {
|
||||
this.addResource(resource);
|
||||
this.invisible = false;
|
||||
})
|
||||
lazyLoadResource(this.scene.load, this.companionName)
|
||||
.then(resource => {
|
||||
this.addResource(resource);
|
||||
this.invisible = false;
|
||||
})
|
||||
.catch(error => console.error(error));
|
||||
|
||||
this.scene.physics.world.enableBody(this);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue