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 the AddButton prefab in the Hierarchy as a child of Toolbar.
  6. Set its Position X to 0.65 so it's a little off to the side.

 

  1. Add the PictureAction script component to the button.
  2. Set its Command to ADD.

The completed toolbar now looks like this:

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.