fix代码格式

This commit is contained in:
2025-05-29 19:15:32 +08:00
parent d5d00fa5ed
commit 6d33a9c8f1
5 changed files with 33 additions and 39 deletions

View File

@@ -24,15 +24,11 @@ export class Main extends Laya.Script {
{ url: respath.trophy_bg_light_gold, type: Laya.Loader.IMAGE }, { url: respath.trophy_bg_light_gold, type: Laya.Loader.IMAGE },
{ url: respath.trophy_bg_light_grey, type: Laya.Loader.IMAGE } { url: respath.trophy_bg_light_grey, type: Laya.Loader.IMAGE }
] ]
Laya.loader.load(resources, Laya.loader.load(resources, Laya.Handler.create(this, (success: object) => { // 第二个参数:成功回调
Laya.Handler.create(this, (success: Object) => { // 第二个参数:成功回调
console.log("预加载资源结束>>>>", success) console.log("预加载资源结束>>>>", success)
}), }), Laya.Handler.create(this, (resProg: number) => { // 第三个参数:进度回调
Laya.Handler.create(this, (resProg: number) => { // 第三个参数:进度回调
console.log("预加载资源进度>>>>", resProg) console.log("预加载资源进度>>>>", resProg)
}) }))
)
} }
onLateUpdate(): void { onLateUpdate(): void {

View File

@@ -38,7 +38,7 @@ export class Block extends Laya.Script {
this.sprite_show = this.owner.getChildByName("Sprite") as Laya.Sprite this.sprite_show = this.owner.getChildByName("Sprite") as Laya.Sprite
this.label_show = this.owner.getChildByName("label_show") as Laya.Label this.label_show = this.owner.getChildByName("label_show") as Laya.Label
let notes = this.owner.getChildByName("notes") const notes = this.owner.getChildByName("notes")
for (let i = 0; i < notes.numChildren; i++) { for (let i = 0; i < notes.numChildren; i++) {
const hbox = notes.getChildAt(i) const hbox = notes.getChildAt(i)
for (let j = 0; j < hbox.numChildren; j++) { for (let j = 0; j < hbox.numChildren; j++) {

View File

@@ -1,17 +1,16 @@
const { regClass, property } = Laya; const { regClass, property } = Laya
@regClass() @regClass()
export class AutoRotate extends Laya.Script { export class AutoRotate extends Laya.Script {
declare owner : Laya.Image; declare owner: Laya.Image
@property(Number) @property(Number)
public speed: number = 1; public speed: number = 1
private begin = 0 private begin = 0
// 第一次执行update之前执行只会执行一次 // 第一次执行update之前执行只会执行一次
onStart(): void { onStart(): void {
Laya.timer.loop(100, this, () => { Laya.timer.loop(100, this, () => {
this.begin += this.speed this.begin += this.speed
if (this.begin >= 360) { if (this.begin >= 360) {
@@ -20,5 +19,4 @@ export class AutoRotate extends Laya.Script {
this.owner.rotation = this.begin this.owner.rotation = this.begin
}) })
} }
} }