Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Augmented Reality for Developers

You're reading from   Augmented Reality for Developers Build practical augmented reality applications with Unity, ARCore, ARKit, and Vuforia

Arrow left icon
Product type Paperback
Published in Oct 2017
Publisher Packt
ISBN-13 9781787286436
Length 548 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Authors (2):
Arrow left icon
Jonathan Linowes Jonathan Linowes
Author Profile Icon Jonathan Linowes
Jonathan Linowes
Krystian Babilinski Krystian Babilinski
Author Profile Icon Krystian Babilinski
Krystian Babilinski
Arrow right icon
View More author details
Toc

Table of Contents (10) Chapters Close

Preface 1. Augment Your World FREE CHAPTER 2. Setting Up Your System 3. Building Your App 4. Augmented Business Cards 5. AR Solar System 6. How to Change a Flat Tire 7. Augmenting the Instruction Manual 8. Room Decoration with AR 9. Poke the Ball Game

Adding a master speed rate UI


One last feature I'd really like to have. When Gametime Per Day of GameController is set to 0.1, the planet orbits are dynamically animated, nice and fast. But that's too fast to see the planet surfaces. When Gametime Per Day is slowed down, say, to 24, we can see the planet texture more clearly, but the orbits are barely noticeable. Let's provide a button to let users toggle between these speeds. Remember, this value is the number of game seconds per earth hour. So, 24 will show one earth day in 24 seconds; 0.05 will show one earth year in about 18 seconds. It should start out fast, and when you press the button, everything slows down, hence, inspect GameController and ensure Gametime Per Day is set to 0.05.

Creating a UI canvas and button

In Unity, user interface (UI) buttons reside on a canvas. Create a canvas:

  1. In Hierarchy, select Create | UI | Canvas.
  2. Select Canvas and change UI Scale Mode to Constant Physical Size.

By default, the Canvas UI Scale Mode is set...

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 €18.99/month. Cancel anytime