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:如果龙骨动画里面只做一个动画,发现没有任何问题,只要有多个动画,切换就有问题