添加持久化逻辑

This commit is contained in:
2025-05-13 20:31:44 +08:00
parent dcb12db40d
commit cbee313bb5
17 changed files with 512 additions and 213 deletions

View File

@@ -1,7 +1,8 @@
import { respath } from "../constants/respath"
import { Home } from "../views/Home"
import { StorageManager } from "./StorageManager"
import { Stage } from "../views/Stage"
const { regClass, property } = Laya
@regClass()
@@ -11,6 +12,9 @@ export class UIManager extends Laya.Script {
private static _instance: UIManager
onAwake(): void {
UIManager._instance = this
StorageManager.getInstance().init()
this.loadHome()
}
@@ -29,7 +33,7 @@ export class UIManager extends Laya.Script {
Laya.loader.load(respath.stage_ui_res).then((go)=>{
var prefab = go.create()
var stage = this.owner.addChild(prefab).getComponent(Stage)
stage.onLoadStage("aBCeIGFhdEDFcAHBGIhigBdfecAgHDiFBCaeBEAGHCIdffcIdEAHbgcABfGEdiHIFHaCDGEBDGEHbiaFC");
stage.onLoadStage(StorageManager.getInstance().loadStage("first"))
})
}