很奇怪Componet的Finish能正常调用。
但是它的 clip 绑定事件,却没有执行。
请问是哪里出了问题呢?
下面是代码:
public BindAnimationEvent() : void
{
this.RoleAnimComponent.on(Animation.EventType.FINISHED, this.onAttackFinished, this);
this.RoleAnimComponent.clips.filter((clip) =>{
if(clip.name == this.AttackAnimationName){
console.log("BindAnimationEvent");
clip.events = [
{
frame: 0.8,
func:"OnDamage",
params:[]
}
]
}
});
this.RoleAnimComponent.clips = this.RoleAnimComponent.clips;
}
start() {
BindAnimationEvent();
}