cocos creator spine动画避坑
·
动画组合
只需要在不同的管道播放就可以了
this.player.getComponent(sp.Skeleton).setAnimation(0, “sheji1”, false);
this.player.getComponent(sp.Skeleton).setAnimation(1, “run2”, true);
动画经常卡死
经常会遇到切换动画时候卡死, 只要在设置播放完毕回调时候加上name, 对应那个动画就可以完美避开动画切换的卡死现象了。
this.player.getComponent(sp.Skeleton).setAnimation(0, “sheji1”, false);
this.player.getComponent(sp.Skeleton).setAnimation(1, “run2”, true);
this.sheji_num–;
this.player.getComponent(sp.Skeleton).setCompleteListener((trackEntry, loopCount) => {
let name: any = trackEntry.animation.name ? trackEntry.animation.name : “”;
if (name === “sheji1”) {
this.changedh();
}
})
更多推荐
所有评论(0)