load texture inside game scene instead inside of inside companion class

This commit is contained in:
Johannes Berthel 2021-04-06 19:10:18 +02:00
parent e5a196a42b
commit 187e21eed9
5 changed files with 20 additions and 15 deletions

View file

@ -69,6 +69,7 @@ import FILE_LOAD_ERROR = Phaser.Loader.Events.FILE_LOAD_ERROR;
import DOMElement = Phaser.GameObjects.DOMElement;
import {Subscription} from "rxjs";
import {worldFullMessageStream} from "../../Connexion/WorldFullMessageStream";
import { lazyLoadCompanionResource } from "../Companion/CompanionTexturesLoadingManager";
export interface GameSceneInitInterface {
initPosition: PointInterface|null,
@ -1024,7 +1025,8 @@ ${escapedMessage}
PlayerAnimationDirections.Down,
false,
this.userInputManager,
this.companion
this.companion,
this.companion !== null ? lazyLoadCompanionResource(this.load, this.companion) : undefined
);
}catch (err){
if(err instanceof TextureError) {
@ -1217,7 +1219,8 @@ ${escapedMessage}
texturesPromise,
addPlayerData.position.direction as PlayerAnimationDirections,
addPlayerData.position.moving,
addPlayerData.companion
addPlayerData.companion,
addPlayerData.companion !== null ? lazyLoadCompanionResource(this.load, addPlayerData.companion) : undefined
);
this.MapPlayers.add(player);
this.MapPlayersByKey.set(player.userId, player);