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

fix: 找不到loadingLayer

parent 54d79287
...@@ -202,6 +202,7 @@ cc.Class({ ...@@ -202,6 +202,7 @@ cc.Class({
async initView() { async initView() {
const loadingLayerBase = cc.find("Canvas/bg/loadingLayerBase"); const loadingLayerBase = cc.find("Canvas/bg/loadingLayerBase");
const loadingLayerNode = cc.instantiate(this.loadingLayerProfab); const loadingLayerNode = cc.instantiate(this.loadingLayerProfab);
loadingLayerNode.name = 'loadingLayerNode';
loadingLayerBase.addChild(loadingLayerNode); loadingLayerBase.addChild(loadingLayerNode);
this.loadingLayer = loadingLayerNode.getComponent("LoadingLayer"); this.loadingLayer = loadingLayerNode.getComponent("LoadingLayer");
...@@ -437,8 +438,9 @@ cc.Class({ ...@@ -437,8 +438,9 @@ cc.Class({
headUrl: player.headUrl, headUrl: player.headUrl,
}); });
} }
console.log('this.loadingLayer.addPlayer'); const loadingLayerNode = cc.find('Canvas/bg/loadingLayerBase/loadingLayerNode');
this.loadingLayer.addPlayer( const loadingLayer = loadingLayerNode.getComponent('LoadingLayer')
loadingLayer.addPlayer(
player.name, player.name,
player.uuid == this.playerId, player.uuid == this.playerId,
player.headUrl, player.headUrl,
...@@ -484,7 +486,6 @@ cc.Class({ ...@@ -484,7 +486,6 @@ cc.Class({
this.isRoomOwner = true; this.isRoomOwner = true;
this.server = new GameServer(5, this.networkHelper); this.server = new GameServer(5, this.networkHelper);
await this.networkHelper.startFrameSync(); await this.networkHelper.startFrameSync();
console.log('this.server.addPlayer');
this.server.addPlayer({ this.server.addPlayer({
uuid: this.playerId, uuid: this.playerId,
isAI: false, 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