FMS.ts 754 B

123456789101112131415161718192021222324252627282930313233
  1. import { _decorator, Component, Node } from 'cc';
  2. import { FMSRegister, IFMS } from '../../core/util_class/FMS';
  3. import { gui } from '../../core/ui/ui';
  4. import { UI_Main } from '../ui/main/UI_Main';
  5. import { UI_Hall } from '../ui/UI_Hall/UI_Hall';
  6. const { ccclass, property } = _decorator;
  7. export enum FMSType {
  8. Main = "main",
  9. Hall = "Hall"
  10. }
  11. @FMSRegister(FMSType.Main)
  12. export class FMSMain implements IFMS {
  13. type: string;
  14. onExit(): void {
  15. gui.close(UI_Main);
  16. }
  17. onEntry(): void {
  18. gui.show(UI_Main);
  19. }
  20. }
  21. @FMSRegister(FMSType.Hall)
  22. export class FMSHall implements IFMS {
  23. type: string;
  24. onExit(): void {
  25. gui.close(UI_Hall);
  26. }
  27. onEntry(): void {
  28. gui.show(UI_Hall);
  29. }
  30. }