Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletter Hub
Free Learning
Arrow right icon
timer SALE ENDS IN
0 Days
:
00 Hours
:
00 Minutes
:
00 Seconds
Arrow up icon
GO TO TOP
Unity 5.x Animation Cookbook

You're reading from   Unity 5.x Animation Cookbook An advanced solution to all your Animation problems

Arrow left icon
Product type Paperback
Published in May 2016
Publisher Packt
ISBN-13 9781785883910
Length 328 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
 Szczesnik Szczesnik
Author Profile Icon Szczesnik
Szczesnik
Arrow right icon
View More author details
Toc

Table of Contents (17) Chapters Close

Title Page
Credits
About the Author
About the Reviewer
www.PacktPub.com
Preface
1. Working with Animations FREE CHAPTER 2. Working with the Animation View 3. 2D and User Interface Animation 4. Character Movement 5. Character Actions and Expressions 6. Handling Combat 7. Special Effects 8. Animating Cutscenes 9. Physics and Animations 10. Miscellaneous Index

Using Mecanim states for animating UI button states


Unity has a very powerful built in UI system. An important part of it is buttons. Buttons have four states: NormalHighlightedPressed, and Disabled. You can use the default Color Tint option to visualize those states, but there is a more interesting option: the animation transition. This recipe covers it.

Getting ready

You don't need to prepare anything before hand as we will create animated buttons from scratch in Unity. You can also use the provided example Unity project and go to the Chapter 03 2D and user interface animation\Recipe 08 Using Mecanim states for animating UI button states directory. You will find an Example.unity scene there. Open it, play the game, and click on the buttons to see the effect.

How to do it...

To create an animated button, follow these steps:

  1. (Optional) Import the Button graphic to Unity.
  2. Open a scene and create a new Button by using the Game Object | UI | Button command. Canvas and Button game objects will...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime
Visually different images