rp_10012/assets/Game/scripts/game/SpinAni.ts
TJH fd8f8ceb36
Some checks failed
Gitea Actions Demo / Explore-Gitea-Actions (push) Has been cancelled
清理未使用的资源
2025-09-28 14:56:28 +08:00

33 lines
681 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(sp.Skeleton)
private rotateSpine: sp.Skeleton = null;
onLoad() {
this.playIdleSpin()
}
private playIdleSpin() {
this.rotateSpine.timeScale = 1
this.rotateSpine.setAnimation(0, 'idle', true)
}
public startSpin() {
this.rotateSpine.setAnimation(0, 'Click', true)
// this.rotateSpine.addAnimation(0, 'Unclicked', true)
}
public stopSpin() {
this.playIdleSpin();
}
}