Hi , i`m trying create a AnimationEvent by Script… Anyone know help me ? i didn’t found any unity API Reference for this.
I found the solution …
AnimationEvent[ ] events = new AnimationEvent[Count];
for…
events = new AnimationEvent {functionName = “FunctionName”, stringParameter = “Param” ,time = “time”};
endfor
AnimationUtility.SetAnimationEvents(clip, events);
Now i have other problem … when Added AnimationsEvent … i’m only be adding 5 for each frame?? I’m trying add manually, but still see only five … anyone can say why?
My old problem of quantity limits AnimationEvents was an error in my code … I’m sorry … I found the problem, but now I have noticed that it seems that there is a lag of a function call and the timeline Animator … . AnimationEvent for example I made a call to one ChangeSprite method (string s) in which this method would change the image of the object through the string it received … but unfortunately for me I noticed that using the direct option to change the direct Sprite Animator will much faster …
Could anyone tell me if the lag actually exists or if I’m doing something wrong?