rp_11001/assets/Game/scripts/game/SpinAni.ts
TJH f466306084
All checks were successful
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 1m19s
代码整理
2025-12-22 16:17:40 +08:00

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();
}
}