2.4.0版本骨骼动画sample未生效

@property(cc.Slider)

slider: cc.Slider = null;

animation : cc.SkeletonAnimation = null;

onLoad () {

    this.animation = this.node.getComponent(cc.SkeletonAnimation);

    this.animation.getClips()[0].wrapMode = 0;

    this.animation.setCurrentTime(1.4);

    this.animation.sample(this.animation.getClips()[0].name);

    // this.animation.play();

    console.log(this.animation.getClips()[0].duration);

}

start () {

    this.slider.node.on("slide",(val:cc.Slider)=>{

        let progress = val.progress;

        this.animation.setCurrentTime(progress * this.animation.getClips()[0].duration,this.animation.getClips()[0].name);

        this.animation.sample(this.animation.getClips()[0].name);

    });

}

在设置动画时间时,sample未生效

已经修复,会进到 2.4.4 版本
https://github.com/cocos-creator/engine/pull/7943/files

感谢大佬,tween和骨骼动画,都建议升级一下,未play的时候,直接按动画进度sample可以生效

该主题在最后一个回复创建后7天后自动关闭。不再允许新的回复。