EventManager.ts 858 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. import { _decorator, Color, director, EventTarget, Label } from 'cc';
  2. import { DEBUG } from 'cc/env';
  3. const { ccclass, property } = _decorator;
  4. /**
  5. * @description 本地存储管理
  6. */
  7. export class EventManager {
  8. static EventType = {
  9. Add_haert: 'Add_haert',
  10. Cut_haert: 'Cut_haert',
  11. Add_Score: 'Add_Score',
  12. Reset_Score: 'Reset_Score',
  13. Set_Add_Score_BOOL: 'Set_Add_Score_BOOL',
  14. Reset_Role: 'Reset_Role',
  15. Die_Role: 'Die_Role',
  16. initOver: 'initOver',
  17. OpenUIPnael: 'OpenUIPnael',
  18. }
  19. private static _instance: EventManager = null;
  20. static get instance() {
  21. if (this._instance) {
  22. return this._instance;
  23. }
  24. this._instance = new EventManager();
  25. return this._instance;
  26. }
  27. public et: EventTarget = new EventTarget();
  28. ClearAll() {
  29. this.et = null
  30. this.et = new EventTarget();
  31. }
  32. }