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

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