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
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

Abstracting UI elements


We still need to add the image and video content. We could go ahead and add them into our current software design, but we're starting to see a pattern emerge in how we've set things up, and it might make sense to refactor our code, abstracting out some of the common elements.

Note

Refactoring in software development means reworking parts of your code to make it cleaner, more maintainable, and more extendable without modifying the behavior or features.

In this case, we're going to refactor how the controller updates the screen by abstracting out our UI elements. If you noticed, each time we add a new UI element to the view or the model, we need to modify and add it to the controller. It would be cleaner if the controller could just broadcast the fact that there's new data, and the UI elements, listening for such events, could go ahead and update themselves on the screen.

So, we're going to make our own little event system, called InstructionEvent, using UnityEvent.

Adding...

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