整理代码格式

This commit is contained in:
2025-06-10 18:24:50 +08:00
parent 285a1f9efe
commit 17c25ca099
18 changed files with 108 additions and 116 deletions

View File

@@ -2,11 +2,11 @@ import type { DOStage } from "../models/DOStage"
import { config } from "../constants/config"
import { respath } from "../constants/respath"
import { EVENT_TYPES, EventManager } from "../models/EventManager"
import { ResourceManager } from "../models/ResourceManager"
import { StorageManager } from "../models/StorageManager"
import { UIManager } from "../models/UIManager"
import { Difficulty } from "./Difficulty"
import { ResourceManager } from "../models/ResourceManager"
import { Utility_EaseOut, Utility_EaseOut_2 } from "../utils/utility"
import { Difficulty } from "./Difficulty"
const { regClass, property } = Laya
@@ -32,25 +32,24 @@ export class GameOver extends Laya.Script {
onAwake(): void {
this.mask = this.owner.getChildByName("Image") as Laya.Image
this.mask.alpha = 0
Laya.Tween.to(this.mask, {alpha: 0.6}, 400, Utility_EaseOut)
Laya.Tween.to(this.mask, { alpha: 0.6 }, 400, Utility_EaseOut)
this.center = this.owner.getChildByName("center") as Laya.Box
this.center.scaleX = 0.8
this.center.scaleY = 0.8
Laya.Tween.to(this.center, {scaleX: 1, scaleY: 1}, 400, Utility_EaseOut)
Laya.Tween.to(this.center, { scaleX: 1, scaleY: 1 }, 400, Utility_EaseOut)
this.center.alpha = 0
Laya.Tween.to(this.center, {alpha: 1}, 400, Utility_EaseOut)
Laya.Tween.to(this.center, { alpha: 1 }, 400, Utility_EaseOut)
}
destroyUI(): void {
Laya.Tween.to(this.mask, {alpha: 0}, 400, Utility_EaseOut_2)
Laya.Tween.to(this.center, {scaleX: 0.8, scaleY: 0.8}, 400, Utility_EaseOut_2)
Laya.Tween.to(this.center, {alpha: 0}, 400, Utility_EaseOut_2, Laya.Handler.create(this, () => {
Laya.Tween.to(this.mask, { alpha: 0 }, 400, Utility_EaseOut_2)
Laya.Tween.to(this.center, { scaleX: 0.8, scaleY: 0.8 }, 400, Utility_EaseOut_2)
Laya.Tween.to(this.center, { alpha: 0 }, 400, Utility_EaseOut_2, Laya.Handler.create(this, () => {
this.owner.destroy()
}))
}
public onSetStageInfo(doStage: DOStage): void {
this.btn_second.on(Laya.Event.CLICK, this, () => {
doStage.set_mistake(doStage.get_mistake() - 1)
@@ -79,7 +78,7 @@ export class GameOver extends Laya.Script {
UIManager.getInstance().loadStageUI(config.DEFAULT_STAGE_ID)
this.destroyUI()
} else {
ResourceManager.getInstance().loadPrefab(respath.difficulty_ui_res, (go: any)=> {
ResourceManager.getInstance().loadPrefab(respath.difficulty_ui_res, (go: any) => {
const prefab = go.create()
const d = UIManager.getInstance().getUIRoot().addChild(prefab).getComponent(Difficulty)
d.onInit((value: string) => {