In the Project panel, navigate to the Packages > com.meta.xr.sdk.interaction > Runtime > Sample > Objects > UISet > Prefabs > Backplate folder and add a backplate for the UI by dragging the EmptyUIBackplateWithCanvas prefab to the Hierachy panel.
The backplate prefab contains a Canvas, a background for the UI, some basic layout components, and ray and poke interactable components to enable direct touch and raycast interactions with the UI.
In the Hierarchy, select the CanvasRoot. In the Inspector, under Rect Transform, you can use the Width and Height properties to set the size of the Canvas. In this example, we have use the following settings to scale it to a reasonable size for a few components:
Rect Transform > Width: 500
Rect Transform > Height: 250
In the Hierarchy, select the UIBackplate. In the Inspector, under Rect Transform, set the set the Width and Height properties to match the canvas width and height set in the previous step. In this example, we have use the following settings to match the canvas size:
Rect Transform > Width: 500
Rect Transform > Height: 250
Add some UI elements to the panel to interact with by dragging and dropping prefabs from the Packages > com.meta.xr.sdk.interaction > Runtime > Sample > Objects > UISet > Prefabs folder. For example, in the Buttons > UnityUIButtonBased folder, drag the PrimaryButton_IconAndLabel_UnityUIButton prefab to the UIBackplate object in the Hierarchy. The button element appears on the UI. Add as many elements as you desire to create your UI.
Open the Link desktop application on your computer.
Put on your headset, and, when prompted, enable Link.
On your development machine, in Unity Editor, select the Play button.
In your headset, you can interact with the UI directly with your hand.
Test your Interaction with an APK
Build your project into an .apk to test your project.
Make sure your headset is connected to your development machine.
In Unity Editor, select File > Build Profiles.
Click Open Scene List to open the Scene List window.
Add your scene to the Scene List by dragging it from the Project panel or by clicking Add Open Scenes.
Click Build and Run to generate an .apk and run it on your headset. In the File Explorer that opens, select a location to save the .apk to and give it a name. The build process may take a few minutes.
In your headset, you can interact with the UI directly with your hand.
Learn more
Design guidelines
Fonts and icons: Learn about fonts and icons components for immersive experiences.
Panels: Learn about panels components for immersive experiences.
Windows: Learn about windows components for immersive experiences.
Tooltips: Learn about tooltips components for immersive experiences.
Cards: Learn about cards components for immersive experiences.
Dialogs: Learn about dialogs components for immersive experiences.