Supporting Cancel

What if you move or scale or otherwise change the picture and don't like it? The toolbar has a Done button; we should add a Cancel button. Cancel will reset the picture parameters to the values it had before this editing session started. This will be handed in the PictureController component.

Presently, the attributes of the picture we've been editing are FramedImage Transform. In Unity, you need to save them as three separate values for position, rotation, and scale. We will save the starting transform values when we begin editing, and restore them if we cancel editing.

At the top of the class, add the following to PictureController:

File: PictureController.cs private Vector3 startPosition; private Vector3 startScale; private ...

Get Augmented Reality for Developers now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.