给unity3d的老版动画中,添加事件的方法(测试通过):
AnimationEvent event0 = new AnimationEvent();
event0.time =this.animation["run"].length * 0.2f;
event0.functionName ="xxx";
event0.stringParameter="哈哈!";
animation["run"].clip.AddEvent(event0);
public void xxx(string ss)
{
Debug.Log(ss);
}