How do I translate animation[.name].time into Unity5 compatible C# code?


I am following a tutorial right now and while i could easily convert all other animation commands with GetComponent, i am not finding any solution to this one:


Note: What this is supposed to do in the bigger script, is to inflict dmg against the enemy at a certain point of the animation and stop the animation after a certain amount of time of the animation

Any help with converting this particular commands or finding a workaround is appreciated.

Also I would like to know how to import legacy animations into the animator controller, because many models in the Asset Store are using those and its way easier to work the animator controller.


This is embarassing, but hey: for everyone else who is looking at this problem, it is:

if(GetComponent<Animation>()[].time>0.9* GetComponent<Animation>()[].length)

Still - how can i use legacy animations with the animator controller?