All checks were successful
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 1m19s
30 lines
606 B
TypeScript
30 lines
606 B
TypeScript
import { _decorator, CCInteger, Component, tween, Vec3, Node, Animation, Tween, Skeleton, sp } from 'cc';
|
|
const { ccclass, property } = _decorator;
|
|
|
|
@ccclass('SpinAni')
|
|
export class SpinAni extends Component {
|
|
|
|
@property(Node)
|
|
private rotateNode: Node = null;
|
|
|
|
onLoad() {
|
|
this.playIdleSpin()
|
|
}
|
|
|
|
private playIdleSpin() {
|
|
this.rotateNode.getComponent(sp.Skeleton).setAnimation(0, '1', true)
|
|
}
|
|
|
|
public startSpin() {
|
|
this.rotateNode.getComponent(sp.Skeleton).setAnimation(0, '2', true)
|
|
}
|
|
|
|
public stopSpin() {
|
|
this.playIdleSpin();
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|