// Learn TypeScript: // - https://docs.cocos.com/creator/manual/en/scripting/typescript.html // Learn Attribute: // - https://docs.cocos.com/creator/manual/en/scripting/reference/attributes.html // Learn life-cycle callbacks: // - https://docs.cocos.com/creator/manual/en/scripting/life-cycle-callbacks.html const {ccclass, property} = cc._decorator; @ccclass export default class PropIntroduceNode extends cc.Component { @property(cc.Label) nameLabel: cc.Label = null; @property(cc.Label) descLabel: cc.Label = null; // LIFE-CYCLE CALLBACKS: // onLoad () {} start () { } initView(name:string,desc:string){ if(cc.isValid(this.nameLabel)){ this.nameLabel.string = name } if(cc.isValid(this.descLabel)){ this.descLabel.string = desc } this.scheduleOnce(()=>{ if(cc.isValid(this.node)){ this.node.destroy() } },1.2) } // update (dt) {} }