sp.Skeleton spin动画 this.spin.animation 这个只有在setAnimation的时候设置 加了 addAnimation 的时候。动画走到了add的动画 this.spin.animation这个值不对。这个就是这样的还是bug?

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)

    }

}

}

找到方法了 用的不对 不能直接用spin上的animation ,要先用getCurrent获取当前播放的trackEntry 再.animation.name。
this.spin.getCurrent(0).animation.name