I'm working on an animation system for an RTS game. Each unit has several animation states: Move, Idle, Engaging, etc.. Units also have a variety of "Animation Impulses" which are animations that get played on top of the animation state. They're for things like shooting or casting a spell. When the impulse finishes, the unit returns to its current animation state.
Using Unity Mecanim Animators, how can I make a system like this? Is there a way to PlayOneShot an impulse animation that reverts back to a base animation when the impulse finishes?
I.e. a unit is in the state of pointing his gun at the target. The unit fires its gun and acts out the recoil. After the recoil animation finishes, the unit returns to pointing its gun at the target.