import { _decorator, Component, Node, sp, tween } from ‘cc’;
const { ccclass, property } = _decorator;
@ccclass(‘Test’)
export class Test extends Component {
@property(sp.Skeleton)
spin:sp.Skeleton = null
start() {
tween(this).repeatForever(
tween(this).delay(4).call(()=>{
this.spin.setAnimation(0,"2wild_merge",false)
this.spin.addAnimation(0,"2wild_win",true)
}).delay(4).call(()=>{
this.spin.setAnimation(0,"3wild_merge",false)
this.spin.addAnimation(0,"3wild_win",true)
})
).start()
}
curTime = 0
update(deltaTime: number) {
this.curTime += deltaTime
if(this.curTime >= 1){
this.curTime = 0
console.log("animation ==> ",this.spin.animation)
}
}
}
