EventManager.ts 831 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  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. OpenUIPnael: 'OpenUIPnael',
  17. }
  18. private static _instance: EventManager = null;
  19. static get instance() {
  20. if (this._instance) {
  21. return this._instance;
  22. }
  23. this._instance = new EventManager();
  24. return this._instance;
  25. }
  26. public et: EventTarget = new EventTarget();
  27. ClearAll() {
  28. this.et = null
  29. this.et = new EventTarget();
  30. }
  31. }