格式化代码 var to let or const
This commit is contained in:
@@ -47,7 +47,7 @@ export class Home extends Laya.Script {
|
||||
|
||||
// 组件被激活后执行,此时所有节点和组件均已创建完毕,此方法只执行一次
|
||||
onAwake(): void {
|
||||
var user = StorageManager.getInstance().getUser()
|
||||
const user = StorageManager.getInstance().getUser()
|
||||
const now = new Date()
|
||||
const nowYear = now.getFullYear()
|
||||
const nowMonth = now.getMonth() + 1
|
||||
@@ -104,11 +104,11 @@ export class Home extends Laya.Script {
|
||||
|
||||
this.btn_new_blue.on(Laya.Event.CLICK, this, this.onClickNew)
|
||||
this.btn_new_white.on(Laya.Event.CLICK, this, this.onClickNew)
|
||||
this.btn_go.on(Laya.Event.CLICK, this, (evt: Laya.Event) => {
|
||||
this.btn_go.on(Laya.Event.CLICK, this, () => {
|
||||
UIManager.getInstance().loadStageUI(config.DEFAULT_STAGE_ID)
|
||||
this.owner.destroy()
|
||||
})
|
||||
var user = StorageManager.getInstance().getUser()
|
||||
|
||||
if (user.get_done(config.DEFAULT_STAGE_ID) >= 1) {
|
||||
console.log("当前主线关卡完成")
|
||||
this.btn_new_blue.visible = true
|
||||
@@ -149,7 +149,7 @@ export class Home extends Laya.Script {
|
||||
// ======
|
||||
}
|
||||
|
||||
public onClickNew(evt: Laya.Event): void {
|
||||
public onClickNew(_evt: Laya.Event): void {
|
||||
Laya.loader.load(respath.difficulty_ui_res).then((go) => {
|
||||
const prefab = go.create()
|
||||
const d = UIManager.getInstance().getUIRoot().addChild(prefab).getComponent(Difficulty)
|
||||
|
||||
Reference in New Issue
Block a user