DialogButton.ts 378 B

1234567891011121314151617181920212223
  1. /**
  2. * 界面上弹出的按钮
  3. */
  4. const {ccclass, property} = cc._decorator;
  5. @ccclass
  6. export default class DialogButton extends cc.Component {
  7. @property(cc.Label)
  8. label: cc.Label = null;
  9. public callback:()=>void;
  10. public setCallback(callback:()=>void){
  11. this.callback = callback;
  12. }
  13. public onclick(){
  14. this.callback();
  15. }
  16. }