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

}



