整理代码格式

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

@@ -3,11 +3,10 @@ import { ResourceManager } from "../models/ResourceManager"
import { UIManager } from "../models/UIManager"
import { Utility_EaseOut, Utility_EaseOut_2 } from "../utils/utility"
const { regClass, property } = Laya
export function G_ShowCommonTips(title: string, content: string, showToggle: boolean, func: any): void {
ResourceManager.getInstance().loadPrefab(respath.common_tips_ui_res, (go: any)=> {
ResourceManager.getInstance().loadPrefab(respath.common_tips_ui_res, (go: any) => {
const prefab = go.create()
const obj = UIManager.getInstance().getUIRoot().addChild(prefab).getComponent(CommonTips)
obj.showCommonTips(title, content, showToggle, func)
@@ -44,20 +43,20 @@ export class CommonTips 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()
}))
}