/** * 对话框-牢笼 */ const {ccclass, property} = cc._decorator; @ccclass export default class DialogCage extends cc.Component { @property(cc.Label) label: cc.Label = null; public callback:()=>void; public setCallback(callback:()=>void){ this.callback = callback; } public close(){ this.node.destroy(); } public onclickOK(){ this.close(); this.callback(); } public onclickCancel(){ this.node.destroy(); } }