添加持久化逻辑
This commit is contained in:
@@ -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"))
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user