I want to move from NGUI to the new (I suppose it’s not so new anymore) Unity UI. I was wondering if there is something similar in Unity UI to NGUI’s UICamera where mouse and touch input are all handled equally, so you don’t have to implement functions like OnMouseUp(), OnMouseDown(), and so on. Is there anything like that or should I keep using UICamera even if I move to Unity UI?
If you create a canvas (the equivalent of the NGUI uiCamera) unity will generate a gameobject called “EventSystem” that holds Input modules for different inputs.
The standard setup will generate click events on all UI elements.
If working on the new ui ,you should not use the OnMouseUp() or the equivalent form NGUI.
There is no need to keep the old UICamera around anymore. You should make a hard cut and replace all the NGUI components with the new uGUI components.
Best start with the tutorials on the unity learning site for getting a overview over the new UI behavior, it’s not the same as NGUI.
Add a physics raycaster to your main camera. Implement the appropriate interfaces on your objects with colliders. Then the EventSystem will work for both UI elements and colliders.