How it works...

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 TriggerHighlighted TriggerPressed Trigger, and DisabledTrigger. Unity will try to call those triggers in the Button's Animator Controller to transition to a proper button state. If you change the Trigger names in the Animator Controller, make sure to change them also in the Button component.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.145.33.235