cocos creator 2.0.9龙骨动画回调问题


createLeaf() {
    this.m_leafEff = cc.instantiate(this.m_leafFab)
    this.m_spritesNode.addChild(this.m_leafEff)
    this.m_leafEff.active = true
    this.m_leafEff.setPosition(this.m_cubePosList[idx])
    this.m_leafArma=this.m_leafEff.getComponent(dragonBones.ArmatureDisplay)
    this.m_leafArma.addEventListener(dragonBones.EventObject.COMPLETE,this.leafAniEnd,this)
}
releaseLeaf () {
        console.log("Frog_Game releaseLeaf start")
        if (this.m_leafArma) {
            this.m_leafArma.removeEventListener(dragonBones.EventObject.COMPLETE,this.leafAniEnd,this)
        }
       if (this.m_leafEff) {
            this.m_spritesNode.removeChild(this.m_leafEff)
        }
        this.m_leafArma = null
        this.m_leafEff = null
        console.log("Frog_Game releaseLeaf end")
 }
leafAniEnd () {
        this.releaseLeaf()
        this.m_isLeafMove = false
        //动画播放完毕
    }

龙骨动画做成了一个prefab,做了上下左右四个方向的动画,在调用的时候发现,第一步先播向上的动画this.m_leafArma.playAnimation(“up”,1),正常能收到回调,调用了releaseLeaf(),然后再播放向左的动画this.m_leafArma.playAnimation(“left”,1),再次调用createLeaf(),结果动画没播,回调也没收到

备注1:在2.0.7版本以前播放切换任何动画都没有任何问题,升级之后就不行了。
备注2:如果龙骨动画里面只做一个动画,发现没有任何问题,只要有多个动画,切换就有问题

帖子要沉么

我看下,你需要确保你的动画是否播放结束了。
我这边测试是正常的。

一个动作只有5帧,肯定是播完了,会不会是写法有什么问题

应该没有问题,我跑了你的代码。
你可以把demo发给我,我帮你看下。