Tasharen Entertainment Forum
Support => NGUI 3 Support => Topic started by: Tatanan on September 18, 2014, 05:11:26 AM
-
I usually work with UICamera with Event Type = 2D UI, since my game and interface are fully 2D.
However your default prefabs (like checkbox...) are not working to me with 2D UI. However, when switching to 3D UI, it start working.
Why? Which is the reason?
and
How should I set up the UI Camera?
Thank you.
-
I think I have a partial response:
It seems 2D camera need 2D colliders and 3D camera need 3D colliders?
Is it exactly that?
-
UICamera's event type determines what type of events are sent out. If it's set to 3D, then Physics.Raycast will be used, hitting Collider objects. If it's 2D, then Physics2D will be used instead, hitting BoxCollider objects. Whether it's UI or World then determines how the results are sorted. If it's UI, then all hits are sorted by widget depth. If it's World, then it's just as-is, based on the Z position.
-
Ok, but in practise, how does this affect?
It seems 2D camera need 2D colliders and 3D camera need 3D colliders?
Is it exactly that?
I'm asking because your prefabs are not working on my scene and maybe it's just because your prefabs are using 3D colliders or something like that.
Thank you
-
?
I've already explained it in the previous post. UICamera's Event Type determines whether 2D or 3D colliders are used.
UnityEngine.Camera type (ortho / perspective mode) has no effect.