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 and deleting framed pictures


There's just a couple more features to add to the project. So far, we've been working with only a single picture. We want to add many pictures to decorate the walls! Fortunately, our DefaultPicture object is very self-contained, with its toolbar and menus and all. So one approach is to save the DefaultPicture as a prefab and then instantiate new copies of it for each new image we add to the scene.

The plan is to add Add and Delete buttons to the toolbar. Clicking Add will create a new picture in the scene. Clicking Delete will remove the current picture from the scene.

Let's set that up now.

Add and Delete in the Toolbar

We'll first add the Add and Delete buttons to the toolbar:

  1. From the Project Assets/SimpleIcons/Prefabs folder, drag the DeleteButton prefab to the Hierarchy as a child of Toolbar.
  2. Set its Position X to 0.15.
  3. Add the PictureAction script component to the button.
  4. Set its Command to DELETE.
  5. From the Project Assets/SimpleIcons/Prefabs folder, drag...
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