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 with Unity AR Foundation

You're reading from   Augmented Reality with Unity AR Foundation A practical guide to cross-platform AR development with Unity 2020 and later versions

Arrow left icon
Product type Paperback
Published in Aug 2021
Publisher Packt
ISBN-13 9781838982591
Length 382 pages
Edition 1st Edition
Languages
Arrow right icon
Author (1):
Arrow left icon
Jonathan Linowes Jonathan Linowes
Author Profile Icon Jonathan Linowes
Jonathan Linowes
Arrow right icon
View More author details
Toc

Table of Contents (14) Chapters Close

Preface 1. Section 1 – Getting Started with Augmented Reality
2. Chapter 1: Setting Up for AR Development FREE CHAPTER 3. Chapter 2: Your First AR Scene 4. Chapter 3: Improving the Developer Workflow 5. Section 2 – A Reusable AR User Framework
6. Chapter 4: Creating an AR User Framework 7. Chapter 5: Using the AR User Framework 8. Section 3 – Building More AR Projects
9. Chapter 6: Gallery: Building an AR App 10. Chapter 7: Gallery: Editing Virtual Objects 11. Chapter 8: Planets: Tracking Images 12. Chapter 9: Selfies: Making Funny Faces 13. Other Books You May Enjoy

Replacing the picture's image

When you add a picture from the Main menu, the Select Image menu is displayed. From here, you can pick a picture. At this point, you will be prompted to add a FramedPhoto to the scene using the image you selected. We implemented this by adding a separate SelectImage Mode. We now want to make that mode serve two purposes. It's called from Main-mode when you're adding a new, framed photo to the scene, and it's called from EditPicture-mode when you want to replace the image of an existing framed photo that's already in the scene. This requires us to refactor the code.

Currently, when we build the Select Image buttons (in the ImageButtons script) we have it configure and enable AddPicture-mode directly. Instead, it now needs to depend on how SelectImage-mode is being used, so we'll move that code from ImageButtons to SelectImageMode, as follows:

  1. Edit the SelectImageMode script and add a reference to AddPictureMode at...
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