我在prefab资源上挂载了一个动画组件,可是却在运行时,未播放该动画组件,求教这是怎么一回事?

我想在由于prefab资源是循环出现的,所以我想在这个prefab资源执行destory之前,让其播放一段动画。
onPicked: function() {
this.BOom();
this.node.destroy();
},
BOom: function(){
var animationComponent = this.getComponent(cc.Animation)
this.animationComponent.play(“small”)
},
可是在执行的时候,这个动画却没有出现?
我测试的时候发现,用于播放的对象已经获取到了animationclips的参数了,这是为咩呢?
animationComponent.play("small"); 这才是对的,this.animationComponent 是 undefined
我题目写错了,我代码里就是没有this的,可是也不行呢
给destroy一个延时执行,延长时间比动画持续时间稍长一些
你是说,在this.node.destroy()处的destroy进行延迟?
用setTimeout执行你的销毁操作