Activating the frame menu

The Frame menu should not be visible until the user activates it. We can add this command to the PictureController and activate it from the toolbar. Add the FRAME command to PictureController script, as follows:

File: PictureController.cs

At the top of the PictureController class add a public variable for the frameMenu as follows:

    public GameObject frameMenu; 
 

In its Execute() function's switch statement, add:

            case PictureCommand.FRAME: 
                OpenFrameMenu(); 
                break; 

Then add the action function:

    private void OpenFrameMenu() { 
        frameMenu.SetActive(true); 
    } 

Save the file. Now go back to Unity:

  1. Drag the FrameMenu into the FrameMenu slot of the Picture Controller.
  2. In the Hierarchy, disable the FrameMenu object (uncheck ...

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.