This recipe has a few key elements that make it work:
- Button Animator Controller: When you click on the Auto Generate Animation button, not only the Animation Clips are created, but also an Animator Controller is. It is also automatically assigned to the button (along with an Animator component). All the transitions between animation states in the Animator Controller are also already set up. Unity also creates parameters in the Animator Controller for you-those are the Trigger parameters used for transitions between the button states.
- Calling the Triggers: You can find four properties in the Button component: Normal Trigger, Highlighted Trigger, Pressed Trigger, and DisabledTrigger. Unity will try to call those triggers in ...