This commit is contained in:
szrpf 2023-05-26 16:20:37 +08:00
parent 046002dcbe
commit 08dd874a91

View File

@ -142,12 +142,12 @@ export default class DataBoard extends cc.Component {
private customLabelStringSplit: string[] = null; private customLabelStringSplit: string[] = null;
private monitorComp: cc.Component = null; private monitorComp: cc.Component = null;
protected onLoad() { protected start() {
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();
@ -310,7 +310,7 @@ export default class DataBoard extends cc.Component {
if (cc.isValid(this.boardNode)) { if (cc.isValid(this.boardNode)) {
this.boardNode.removeFromParent(); this.boardNode.removeFromParent();
this.boardNode.destroy(); this.boardNode.destroy();
}; }
this.node.targetOff(this); this.node.targetOff(this);
} }
} }