There are two questions about using GUI in Unity3d. Recently tried to use NGUI, instead of the standard Unity GUI. But I just can not figure out how to interact through the code with the elements of the scene. I threw a couple of buttons and a panel. The panel is out of sight. When you press the button, the panel should go to the center of the camera.

I rummaged through the documentation, but did not understand how to use all this. I would be grateful if you show or give a link where it is described.

Due to the fact that now for me NGUI, like a dark forest, I thought, and can I still use a standard wrapper?

In fact, only data from text fields will be sent to the server. There are no miscalculations of the physics of 3D models and there is no such thing. Ie 2D interface.

Accordingly, with a large number of elements from the standard GUI, the number of drowcalls will increase.

Will this be a big disadvantage in performance, even if 2D? How to deal with non-standard elements?

  • All non-standard elements can be done using standard components, NGUI also helps very well with ready-made functions and handlers, without it you have to write all the logic of work manually. And the GUI is very heavy for mobile platforms, it’s better to do it either with your own interface with three d buttons or using NGUI for 2D image display, especially since it optimizes very well for different screens what you yourself do manually. - dajver

1 answer 1

  1. Create a canvas
  2. Adjust the canvas to the desired mode and attach it to your main camera. You need a camera overlay or something like that along the way. I do not remember already.
  3. You place the necessary objects on the canvas
  4. Disable or enable the necessary panels on the canvas to switch between menus.

GUI is very slow against NGUI. I advise them not to use okrome both for test purposes and in small quantities. (for example, give the number of FPS)