Signed-off-by: szrpf <27185709@qq.com>

This commit is contained in:
szrpf 2023-04-22 15:30:30 +08:00
parent 3fa99bf3ec
commit a48fa6b879

View File

@ -146,11 +146,11 @@ export default class DataBoard extends cc.Component {
private monitorComp: cc.Component = null; private monitorComp: cc.Component = null;
protected onLoad() { protected onLoad() {
this.boardNode = this.node.getChildByName('DataBoard');
if (!CC_EDITOR && !window['DATABOARD']) { if (!CC_EDITOR && !window['DATABOARD']) {
this.destroy(); this.destroy();
return; return;
} }
this.boardNode = this.node.getChildByName('DataBoard');
if (cc.isValid(this.boardNode)) { if (cc.isValid(this.boardNode)) {
this.boardNode.removeFromParent(); this.boardNode.removeFromParent();
this.boardNode.destroy(); this.boardNode.destroy();