const { regClass, property } = Laya

@regClass()
export class AutoRotate extends Laya.Script {
  declare owner: Laya.Image

  @property(Number)
  public speed: number = 0.2

  private begin = 0

  onLateUpdate(): void {
      this.begin += this.speed
      if (this.begin >= 360) {
        this.begin = 0
      }
      this.owner.rotation = this.begin
  }
}
