companion pictures store
This commit is contained in:
parent
5efa17651c
commit
8eaacdf2e5
6 changed files with 110 additions and 7 deletions
|
@ -63,7 +63,7 @@ export abstract class Character extends Container {
|
|||
this.addTextures(textures, frame);
|
||||
this.invisible = false;
|
||||
this.playAnimation(direction, moving);
|
||||
this.emit("textures-loaded");
|
||||
this.emit("woka-textures-loaded");
|
||||
})
|
||||
.catch(() => {
|
||||
return lazyLoadPlayerCharacterTextures(scene.load, ["color_22", "eyes_23"]).then((textures) => {
|
||||
|
@ -151,6 +151,9 @@ export abstract class Character extends Container {
|
|||
public addCompanion(name: string, texturePromise?: Promise<string>): void {
|
||||
if (typeof texturePromise !== "undefined") {
|
||||
this.companion = new Companion(this.scene, this.x, this.y, name, texturePromise);
|
||||
this.companion.once("texture-loaded", () => {
|
||||
this.emit("companion-texture-loaded", this.companion?.getSnapshot());
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue