游戏结束
This commit is contained in:
22
src/views/GameDone.ts
Normal file
22
src/views/GameDone.ts
Normal file
@@ -0,0 +1,22 @@
|
||||
import { UIManager } from "../models/UIManager";
|
||||
import { StorageManager } from "../models/StorageManager";
|
||||
|
||||
const { regClass, property } = Laya;
|
||||
|
||||
@regClass()
|
||||
export class GameDone extends Laya.Script {
|
||||
declare owner : Laya.Box;
|
||||
|
||||
@property(Laya.Button)
|
||||
public btn_new: Laya.Button
|
||||
|
||||
//组件被激活后执行,此时所有节点和组件均已创建完毕,此方法只执行一次
|
||||
onAwake(): void {
|
||||
this.btn_new.on(Laya.Event.CLICK, this, (evt: Laya.Event) => {
|
||||
UIManager.getInstance().closeStage();
|
||||
UIManager.getInstance().loadHome();
|
||||
StorageManager.getInstance().cleanStage()
|
||||
this.owner.destroy()
|
||||
})
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user