Currently, I have a script; more specifically for weapons. Handles the animations, and the animations are reproduced and then stopped (once completed) by co-routines. I have variables about the time that certain animations last (in frames), which are designated at the beginning of the script. Then I take that and divide it by the frame rate in which they were animated, for the co-routine of waitForSeconds. The problem is that for each weapon, I have to manually enter the duration of each of its 13 animations in the inspector.
It would be much easier if I could take the animation component that is being played, and have the script determine how long it lasts, convert it into an integer, and use it for the waitForSeconds. I've searched this before (and I did it again), but nothing has worked. If someone needs me to clarify something, please let me know.