0
Answered

How to add custom UI

haoyu yi (Hari) 5 months ago in General Questions updated by Support 5 months ago 4

I would like to ask about how to add custom UI and buttons

I now want to try to add some custom buttons for my own functionality, but when I add a new Text text at the UI level under the game4automation object, I can't view his position in the edit screen. Usually I can view it in the edit screen and adjust his position and Canvas size, but now I can't see it in the realvirtual template project.

Can you tell me how I can get the UI object to show up in edit mode or how to implement a custom button to achieve the functionality I want for myself, I didn't find in the documentation how to do it.

Image 1027

Answer

Answer

Oh yes, sorry to mention that the layer also needs to be turned on.

Answered

You should check standard Unity UI documenation:

https://docs.unity3d.com/Packages/com.unity.ugui@2.0/manual/index.html

There are a lot of youtube tutorials available about UnityUI.

To view the UI in Scene view you need to click on an HMI component and it will be focused. HMI components are if they are in screen overlay mode on a special plane in your scene.

If you are having our professional license we are providing some hmi components:

https://doc.realvirtual.io/components-and-scripts/hmi-components

thank u for your reply !

The reason I can't see the UI in the Scene is because the UI objects are all under UI Layers, and the objects under the UI layer are filtered by the layer filter.

Answer

Oh yes, sorry to mention that the layer also needs to be turned on.