First, let's add the MoveButton prefab to the toolbar.
- 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.
- Now let's write the MoveTool.cs script for the button.
- In your Scripts folder, create a new C# script, name it MoveTool, and open it for editing.
- 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 ...