Currently, I have a script; more specifically for weapons. It handles animations, and the animations are being played and then stopped (once they're finished) by co-routines. I have variables for how long certain animations are (in frames), which are designated at the beginning of the script. I then take that and divide it by the frame rate they were animated in, for the co-routine's waitForSeconds. The problem is that for each weapon, I have to manually input how long each of their usually 13 animations is in the inspector.
It'd be a lot easier if I could take the animation component that is being played, and have the script figure out how long it is, convert it to an integer, and use that for the waitForSeconds. I've looked around for this before (and just did again), but nothing has worked. If anyone needs me to clarify something, please let me know.