格式化代码
This commit is contained in:
@@ -1,54 +1,49 @@
|
||||
import type { DOStage } from "../models/DOStage"
|
||||
import { EVENT_TYPES, EventManager } from "../models/EventManager"
|
||||
import { StorageManager } from "../models/StorageManager"
|
||||
import { UIManager } from "../models/UIManager"
|
||||
import { Utility_ConvertSecondToString } from "../utils/utility"
|
||||
|
||||
|
||||
import { UIManager } from "../models/UIManager";
|
||||
import { StorageManager } from "../models/StorageManager";
|
||||
import { Utility_ConvertSecondToString } from "../utils/utility";
|
||||
import { EVENT_TYPES, EventManager } from "../models/EventManager";
|
||||
import { DOStage } from "../models/DOStage";
|
||||
|
||||
|
||||
|
||||
const { regClass, property } = Laya;
|
||||
const { regClass, property } = Laya
|
||||
|
||||
@regClass()
|
||||
export class GamePause extends Laya.Script {
|
||||
declare owner : Laya.Box;
|
||||
declare owner: Laya.Box
|
||||
|
||||
@property(Laya.Label)
|
||||
public label_time: Laya.Label
|
||||
@property(Laya.Label)
|
||||
public label_diffucuty: Laya.Label
|
||||
@property(Laya.Label)
|
||||
public label_time: Laya.Label
|
||||
|
||||
@property(Laya.Sprite)
|
||||
public btn_continue: Laya.Sprite
|
||||
@property(Laya.Sprite)
|
||||
public btn_restart: Laya.Sprite
|
||||
@property(Laya.Label)
|
||||
public label_diffucuty: Laya.Label
|
||||
|
||||
@property(Laya.Sprite)
|
||||
public btn_continue: Laya.Sprite
|
||||
|
||||
//组件被激活后执行,此时所有节点和组件均已创建完毕,此方法只执行一次
|
||||
onAwake(): void {
|
||||
|
||||
}
|
||||
@property(Laya.Sprite)
|
||||
public btn_restart: Laya.Sprite
|
||||
|
||||
public onSetStageInfo(doStage: DOStage): void {
|
||||
// 组件被激活后执行,此时所有节点和组件均已创建完毕,此方法只执行一次
|
||||
onAwake(): void {
|
||||
|
||||
this.label_time.text = Utility_ConvertSecondToString(doStage.get_duration())
|
||||
this.label_diffucuty.text = doStage.get_difficulty()
|
||||
}
|
||||
|
||||
EventManager.getInstance().DispatchEvent(EVENT_TYPES.NOT_UPDATE_PAUSE, true)
|
||||
this.btn_continue.on(Laya.Event.CLICK, this, (evt: Laya.Event) => {
|
||||
EventManager.getInstance().DispatchEvent(EVENT_TYPES.NOT_UPDATE_PAUSE, false)
|
||||
this.owner.destroy()
|
||||
})
|
||||
public onSetStageInfo(doStage: DOStage): void {
|
||||
this.label_time.text = Utility_ConvertSecondToString(doStage.get_duration())
|
||||
this.label_diffucuty.text = doStage.get_difficulty()
|
||||
|
||||
this.btn_restart.on(Laya.Event.CLICK, this, (evt: Laya.Event) => {
|
||||
var stageID = doStage.get_stageID()
|
||||
var type = doStage.get_stageType()
|
||||
var difficulty = doStage.get_difficulty()
|
||||
StorageManager.getInstance().newStage(stageID, type, difficulty, difficulty)
|
||||
UIManager.getInstance().loadStageUI(stageID);
|
||||
this.owner.destroy()
|
||||
})
|
||||
|
||||
}
|
||||
}
|
||||
EventManager.getInstance().DispatchEvent(EVENT_TYPES.NOT_UPDATE_PAUSE, true)
|
||||
this.btn_continue.on(Laya.Event.CLICK, this, (evt: Laya.Event) => {
|
||||
EventManager.getInstance().DispatchEvent(EVENT_TYPES.NOT_UPDATE_PAUSE, false)
|
||||
this.owner.destroy()
|
||||
})
|
||||
|
||||
this.btn_restart.on(Laya.Event.CLICK, this, (evt: Laya.Event) => {
|
||||
const stageID = doStage.get_stageID()
|
||||
const type = doStage.get_stageType()
|
||||
const difficulty = doStage.get_difficulty()
|
||||
StorageManager.getInstance().newStage(stageID, type, difficulty, difficulty)
|
||||
UIManager.getInstance().loadStageUI(stageID)
|
||||
this.owner.destroy()
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user