Enabling the next and previous buttons

In order to interact with the Next and Previous button on our canvas, we need to handle the HoloLens' standard Select gesture as a click, much the same as a mouse click or smartphone screen tap on the Unity UI buttons. We can do this by adding the prefab Input Manager to the scene, and then adding an Input Module component to the existing UI EventSystem:

  1. From the Project Assets / HoloToolkit / Input / Prefabs folder, drag the InputManager into the Hierarchy.
  2. From the Project Assets / HoloToolkit / Input / Prefabs / Cursor folder, drag the CursorWithFeedback into the Hierarchy.
  3. In Hierarchy, with EventSystem selected, Add Component HoloLens Input Module.
  4. Disable the Standalone Input Module, as it won't be needed and we do not want it to interfere with the HoloLens one.

Save the scene and try it in HoloLens. You should now see a cursor following your gaze. And (if you're precise) you might be able to select the Next and Previous buttons to step through the instructions.

You'll probably discover that finding and selecting small things with head movements and your gaze is not nearly as precise as using a mouse or touchscreen. We need to make our buttons bigger.

  1. Within the Hierarchy, select the Previous Button (under Main Canvas / Nav Panel).
  2. Change its Scale to 3.5, 3.5, 3.5 to make it larger.
  3. Set Pos Y to 90, so it's above the content panel.
  4. Set Source Image to UISprite.
  5. Color: # 4AB6D0FF.
  6. Also set its Highlighted Color to something else, such as yellow (#F1FF00FF), to give the user additional visual feedback when they can select the button.

Follow the same steps for the Next Button. Now, when you Play, it should be easier to navigate through the instruction steps, as follows:

For more information on the HoloLensInputModule for Unity and how it translates tap and navigation gestures into emulated mouse input, see https://docs.unity3d.com/ScriptReference/EventSystems.HoloLensInputModule.html.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.119.131.72