Skip to Content
Augmented Reality for Developers
book

Augmented Reality for Developers

by Jonathan Linowes, Krystian Babilinski
October 2017
Intermediate to advanced
548 pages
13h 23m
English
Packt Publishing
Content preview from Augmented Reality for Developers

Add and Delete Commands in PictureController

In the PictureController script, add the following code to the Execute() function:

File: PictureController.cs            case PictureCommand.ADD: 
                AddPicture(); 
                break; 
 
            case PictureCommand.DELETE: 
                DeletePicture(); 
                break; 

Write the corresponding implementations of the commands:

    private void AddPicture() { 
        DoneEdit(); 
        GameController.instance.CreateNewPicture(); 
    } 
 
    private void DeletePicture() { 
        Destroy(gameObject); 
    } 

AddPicture will close the current picture editing and create a new picture via GameController. DeletePicture will delete the current game object.

Let's try it out. Save your work and press Play. Use the toolbar's Add button to create a new picture, move it into place, and create another. Use the ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Augmented Reality Game Development

Augmented Reality Game Development

Micheal Lanham
Augmented Reality

Augmented Reality

Joseph Rampolla, Greg Kipper

Publisher Resources

ISBN: 9781787286436Supplemental Content