|
@@ -165,6 +165,8 @@ export default class XAvatarManager {
|
|
|
this.characterMap.set(5, new Map)
|
|
|
}
|
|
|
loadAvatar({id: e, avatarType: t, priority: r, avatarManager: n, assets: o, status: a}) {
|
|
|
+ // zeg 获得数据为3,现手动修正为0
|
|
|
+ r = 0;
|
|
|
return new Promise((s,l)=>{
|
|
|
if (this.getAvatarById(e))
|
|
|
return l(new DuplicateAvatarIDError(`[Engine] cannot init avatar with the same id = ${e}`));
|
|
@@ -179,30 +181,19 @@ export default class XAvatarManager {
|
|
|
status: a
|
|
|
});
|
|
|
this.registerAvatar(u);
|
|
|
- // if (r == 0)
|
|
|
- // this.setMainAvatar(u.id),
|
|
|
- // this.addAvatarToScene(u, 0).then(c=>(logger.debug(`[Engine] avatar ${u.id} has been added to scene`),
|
|
|
- // c ? (this._updateBillboardStatus(c, BillboardStatus.SHOW),
|
|
|
- // setTimeout(()=>{
|
|
|
- // this.launchProcessLoadingLoop()
|
|
|
- // }
|
|
|
- // , this._delayTime),
|
|
|
- // s(c)) : (u.removeAvatarFromScene(),
|
|
|
- // l(new AvatarAssetLoadingError)))).catch(c=>(u.removeAvatarFromScene(),
|
|
|
- // l(new AvatarAssetLoadingError(c))));
|
|
|
- // else
|
|
|
- // return s(u)
|
|
|
-
|
|
|
- this.setMainAvatar(u.id),
|
|
|
- this.addAvatarToScene(u, 0).then(c=>(logger.debug(`[Engine] avatar ${u.id} has been added to scene`),
|
|
|
- c ? (this._updateBillboardStatus(c, BillboardStatus.SHOW),
|
|
|
- setTimeout(()=>{
|
|
|
- this.launchProcessLoadingLoop()
|
|
|
- }
|
|
|
- , this._delayTime),
|
|
|
- s(c)) : (u.removeAvatarFromScene(),
|
|
|
- l(new AvatarAssetLoadingError)))).catch(c=>(u.removeAvatarFromScene(),
|
|
|
- l(new AvatarAssetLoadingError(c))));
|
|
|
+ if (r == 0)
|
|
|
+ this.setMainAvatar(u.id),
|
|
|
+ this.addAvatarToScene(u, 0).then(c=>(logger.debug(`[Engine] avatar ${u.id} has been added to scene`),
|
|
|
+ c ? (this._updateBillboardStatus(c, BillboardStatus.SHOW),
|
|
|
+ setTimeout(()=>{
|
|
|
+ this.launchProcessLoadingLoop()
|
|
|
+ }
|
|
|
+ , this._delayTime),
|
|
|
+ s(c)) : (u.removeAvatarFromScene(),
|
|
|
+ l(new AvatarAssetLoadingError)))).catch(c=>(u.removeAvatarFromScene(),
|
|
|
+ l(new AvatarAssetLoadingError(c))));
|
|
|
+ else
|
|
|
+ return s(u)
|
|
|
}
|
|
|
)
|
|
|
}
|