Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
HoloLens Beginner???s Guide

You're reading from   HoloLens Beginner???s Guide Join the AR revolution with HoloLens

Arrow left icon
Product type Paperback
Published in Apr 2017
Publisher Packt
ISBN-13 9781786464729
Length 376 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
Jason M. Odom Jason M. Odom
Author Profile Icon Jason M. Odom
Jason M. Odom
Arrow right icon
View More author details
Toc

Table of Contents (11) Chapters Close

Preface Welcome to the New World FREE CHAPTER HoloWorld I am in Control User-Friendly Interface Now That Is How It Should Sound Not So Blank Spaces The Tools of the Trade Share What You Have Got Putting It All Together Fixing Problems

Here is the Game Plan


Before moving ahead, I want to give a quick rundown of what we are doing. We have an object with two animation states: idle and moving. Idle is the default mode. We have created an idle parameter with the checkbox checked, which makes the condition true.

In the next section, we will write a script that has the following two main functions:

  • If the object is selected, it changes idle from true to false or vice versa
  • In the update function, it checks for two conditions: whether idle is true or false and to play the correct animation

When the application loads, you will see the two boxes; because idle is the default state, nothing will happen until they are selected. Once they are, they will move. If they are selected again, they will go idle once more:

  1. With LeftRect selected in the Hierarchy view, search for the Inspector panel, scroll to the bottom, and click on Add Component:
  1. Scroll down to New Script and select it.
  2. Name the new script RectAnim:
  1. Click on Create and Add.

For the...

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 $19.99/month. Cancel anytime
Banner background image