DialogCage.ts 514 B

1234567891011121314151617181920212223242526272829303132
  1. /**
  2. * 对话框-牢笼
  3. */
  4. const {ccclass, property} = cc._decorator;
  5. @ccclass
  6. export default class DialogCage 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 close(){
  14. this.node.destroy();
  15. }
  16. public onclickOK(){
  17. this.close();
  18. this.callback();
  19. }
  20. public onclickCancel(){
  21. this.node.destroy();
  22. }
  23. }