Add the Move button and script

First, let's add the MoveButton prefab to the toolbar.

  1. From Assets/SimpleIcons/Prefabs/, drag the MoveButton prefab into Hierarchy as a child of Toolbar.

If you are not using the SimpleIcons package we provided, you can just add a cube with the scale (0.1, 0.1, 0.04) and name it MoveButton.

  1. Now let's write the MoveTool.cs script for the button.
  2. In your Scripts folder, create a new C# script, name it MoveTool, and open it for editing.
  3. Start to write the script as follows:
File: MoveTool.csusing UnityEngine; using HoloToolkit.Unity.InputModule; public class MoveTool : MonoBehaviour, IInputClickHandler { private bool isEditing; private Vector3 originaButtonScale; private BoxCollider collider; private Vector3 ...

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.