添加结算动画
This commit is contained in:
24
src/views/common/AutoRotate.ts
Normal file
24
src/views/common/AutoRotate.ts
Normal file
@@ -0,0 +1,24 @@
|
||||
const { regClass, property } = Laya;
|
||||
|
||||
@regClass()
|
||||
export class AutoRotate extends Laya.Script {
|
||||
declare owner : Laya.Image;
|
||||
|
||||
@property(Number)
|
||||
public speed: number = 1;
|
||||
|
||||
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
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
3
src/views/common/AutoRotate.ts.meta
Normal file
3
src/views/common/AutoRotate.ts.meta
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"uuid": "b4f67ca3-86fe-409d-a439-63a715243fb7"
|
||||
}
|
||||
Reference in New Issue
Block a user