

The events exposed in the prefab itself as well as the Interactable component can be used to trigger additional actions. The pressable buttons in the HandInteractionExample scene use Interactable's OnClick event to trigger a change in the color of a cube. These button prefabs are already configured to have audio-visual feedback for the various types of inputs, including articulated hand input and gaze. Simply drag PressableButtonHoloLens2 (Assets/MRTK/SDK/Features/UX/Interactable/Prefabs/PressableButtonHoloLens2.prefab) or PressableButtonHoloLens2Unplated (Assets/MRTK/SDK/Features/UX/Interactable/Prefabs/PressableButtonHoloLens2Unplated.prefab) into the scene. Then, drag PressableButtonUnityUI (Assets/MRTK/SDK/Features/UX/Interactable/Prefabs/PressableButtonUnityUI.prefab), PressableButtonUnityUICircular (Assets/MRTK/SDK/Features/UX/Interactable/Prefabs/PressableButtonUnityUICircular.prefab), or PressableButtonHoloLens2UnityUI (Assets/MRTK/SDK/Features/UX/Interactable/Prefabs/PressableButtonHoloLens2UnityUI.prefab) onto the Canvas. Set the Rect Transform component's X, Y, and Z scale to 0.001.Click "Add NearInteractionTouchableUnityUI".
#Icon slate windows how to#
How to use pressable buttons Unity UI based buttonsĬreate a Canvas in your scene (GameObject -> UI -> Canvas). Holograms that are displayed through a transparent plane can be unstable with HoloLens 2's Depth LSR stabilization.It is hard to understand when the event triggers.Icon and text are difficult to read with the physical environment.

Transparent buttons are not recommended because of these usability and stability issues: It combines Interactable script with PressableButton script.įor HoloLens 2, it is recommended to use buttons with an opaque backplate. PressableButtonHoloLens2 (Assets/MRTK/SDK/Features/UX/Interactable/Prefabs/PressableButtonHoloLens2.prefab) is HoloLens 2's shell style button that supports the precise movement of the button for the direct hand tracking input. You can also use voice command to trigger the button. The baseline button supports all available input methods, including articulated hand input for the near interactions as well as gaze + air-tap for the far interactions. The Button (Assets/MRTK/SDK/Features/UX/Interactable/Prefabs/Button.prefab) is based on the Interactable concept to provide easy UI controls for buttons or other types of interactive surfaces.
