ViveInputUtility-UGUI ray interaction (4)

ViveInputUtility is still very friendly to UGUI interaction. Unlike SteamVR, it does not have a ray UI interaction system. The following will directly upload dry goods, and only need to mount components to realize a complete UGUI interaction system.

1. Pre-preparation
Create a new scene 03-UGUI, delete the default camera, create a new empty node Player at the origin, drag the required modules into the Player node, and
then build a UI panel at will, as shown in the figure, here I have created all the commonly used interactive UIs One copy, don’t forget to change the Render Mode of Canvas to World Space, and mount the Canvas Raycast Target component on it.
insert image description here
insert image description here
Yes, mount a component on the canvas, you can directly use the handle ray to interact with the UI, and run it directly test.

2. Special handling of Dropdown
After the above operations, you will find that all other UIs can be interactively operated normally except for Dropdown. Here you need to do special handling for Dropdown. Expand Dropdown and find Template (drop-down box template). Add the Canvas Raycast Target component to it, and it can interact normally.
insert image description here
3. Reduce the return point of the handle ray.
Students will encounter this situation during the operation. The return point of the ray is too large.
insert image description here
We can find the Reticle Poser component on the Reticle under the specified handle, and check the Auto Scale Reticle parameter, which means Automatically scale the aiming point, the default is unchecked. After checking, you will find that the aiming point becomes smaller. Of course, you can also set the pixel of the aiming point through Size In Pixels. Here you can set it as you like.
insert image description here
insert image description here

Guess you like

Origin blog.csdn.net/weixin_38484443/article/details/127320249