2023-11-07 09:17:57 +08:00

32 lines
725 B
TypeScript

import { _decorator, Component, Label} from 'cc';
import { UIManager } from '../../framework/uiManager';
import { Constant } from '../../framework/constant';
const { ccclass, property } = _decorator;
@ccclass('TipPanel')
export class TipPanel extends Component {
@property(Label)
txtTip: Label = null!;
private _callback:Function = null!;
show(tip:string, callback:Function){
this.txtTip.string = tip;
this._callback = callback;
}
onOk(){
if(this._callback){
this._callback();
}
UIManager.instance.hideDialog(Constant.PANEL_NAME.TIP_PANEL);
}
onCancel(){
UIManager.instance.hideDialog(Constant.PANEL_NAME.TIP_PANEL);
}
}