Commit 8f6f4d2a authored by 范雪寒's avatar 范雪寒

fix: 找不到loadingLayer

parent 54d79287
......@@ -202,6 +202,7 @@ cc.Class({
async initView() {
const loadingLayerBase = cc.find("Canvas/bg/loadingLayerBase");
const loadingLayerNode = cc.instantiate(this.loadingLayerProfab);
loadingLayerNode.name = 'loadingLayerNode';
loadingLayerBase.addChild(loadingLayerNode);
this.loadingLayer = loadingLayerNode.getComponent("LoadingLayer");
......@@ -437,8 +438,9 @@ cc.Class({
headUrl: player.headUrl,
});
}
console.log('this.loadingLayer.addPlayer');
this.loadingLayer.addPlayer(
const loadingLayerNode = cc.find('Canvas/bg/loadingLayerBase/loadingLayerNode');
const loadingLayer = loadingLayerNode.getComponent('LoadingLayer')
loadingLayer.addPlayer(
player.name,
player.uuid == this.playerId,
player.headUrl,
......@@ -484,7 +486,6 @@ cc.Class({
this.isRoomOwner = true;
this.server = new GameServer(5, this.networkHelper);
await this.networkHelper.startFrameSync();
console.log('this.server.addPlayer');
this.server.addPlayer({
uuid: this.playerId,
isAI: false,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment