base_ui.ts 620 B

12345678910111213141516171819202122232425
  1. import { _decorator, Component, Node } from 'cc';
  2. import { uiManager } from '../manager/uiManager';
  3. const { ccclass, property } = _decorator;
  4. @ccclass('base_ui')
  5. export class base_ui extends Component {
  6. @property(Node) btn_close:Node = null
  7. protected start(): void {
  8. this.onButtonListen(this.btn_close, ()=>{
  9. this.close()
  10. })
  11. this.init()
  12. }
  13. protected onButtonListen(btn:Node,call_back){
  14. uiManager.Instance().onButtonListen(btn,call_back)
  15. }
  16. protected close(){
  17. this.node.removeFromParent()
  18. }
  19. protected init() {}
  20. }