| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061 |
- import { assetManager, director, Sprite } from "cc";
- import { FMSRegister, IFMS } from "db://assets/core_tgx/util_class/FMS";
- import { aa } from "db://assets/scripts/aa";
- import { UI_Loading } from "db://assets/module_extra/ui_loading/UI_Loading";
- import { UI_Game } from "../../ui/ui_game/UI_Game";
- import { UI_Home } from "../../ui/ui_home/UI_Home";
- import { BgmName } from "db://assets/scripts/Audio/BgmName";
- import { Container } from "../../element/container/Container";
- export enum FMSType {
- home = "Init",
- Start = "Start",
- // Restart = "Restart",
- }
- @FMSRegister(FMSType.home)
- export class FMSInit implements IFMS {
- type: string;
- onExit(): void {
- aa.audio.stop()
- aa.uIMgr.closeUI(UI_Home);
- }
- onEntry(): void {
- aa.uIMgr.showUI(UI_Home);
- aa.audio.play(BgmName.BGM)
- }
- }
- @FMSRegister(FMSType.Start)
- export class FMSStart implements IFMS {
- type: string;
- onExit(): void {
- aa.audio.stop()
- aa.Util.resMgr.clearAll()
- aa.uIMgr.closeUI(UI_Game)
- }
- onEntry(): void {
- // 清空已完成瓶子的位置记录
- // Container.clearFinishedPositions();
-
- aa.audio.play(BgmName.BGM)
- aa.uIMgr.showUI(UI_Loading, (ui) => {
- ui.Init({ bundle: 'module_basic', url: [aa.uIMgr.getPageInfo(UI_Game).path] }, () => {
- aa.uIMgr.showUI(UI_Game)
- })
- })
- }
- }
|