Adds a named animation clip to a game object. Optionally specify first and last frames, and whether to add an extra looping frame to match the first frame.
The game object. If it doesn't have an Animation component, one will be added.
The animation clip to add to the object.
The animation name - used by other animation actions.
Optionally trim the animation by setting first and last frames.
Last frame of the trimmed animation.
Add Loop Frame
Add a frame at the end of the trimmed clip that's the same as the first frame so it loops nicely.