Author Topic: NGUI 3.0.0e and colliders size.  (Read 2080 times)

7realm

  • Guest
NGUI 3.0.0e and colliders size.
« on: September 30, 2013, 12:39:12 AM »
Hi all,

This is my first post on this forum, despite I am big fan of NGUI and using it for almost a year in all my projects.

In the latest version that I have(3.0.0e), there is one problem when we call NormalizeDepth, it resets box colliders for gameobjects that does not have widgets. That is bad, because I have a lot of such colliders and as soon as I adjust depth to any of my widgets I loose all values for colliders.

Another issue here is, if I have custom collider, for example for particle system and label. After NormalizeDepth, this collider is reset to be only for label.

I have done some quick fixes for this, but I think this should be fixed on package layer.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: NGUI 3.0.0e and colliders size.
« Reply #1 on: September 30, 2013, 11:05:43 AM »
The adjustment of colliders that don't have widgets is necessary, otherwise the traditional button (game object with UIButton + collider, then child sprite + child label) wouldn't be updated when you change the depth. I plan on getting rid of the need to have colliders altogether in a future version.

7realm

  • Guest
Re: NGUI 3.0.0e and colliders size.
« Reply #2 on: October 01, 2013, 01:16:01 AM »
I understand the case of traditional UIButton, and that is ok, but in my case gameobject with collider does not have any child widgets at all. In your example this will be UIButton + collider WITHOUT child sprite and label.

One place, were I use this, is that I use particle system instead of UISprite for button "background", and particle system is not a widget.
Another case is when I use complex, not-rectangular background map, and I put a lot of UIButton without widgets over it make its areas clickable.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: NGUI 3.0.0e and colliders size.
« Reply #3 on: October 01, 2013, 07:17:50 PM »
Well if you don't want this functionality then just comment it out. Open up NGUITools, navigate to line 580, and comment it out (NGUITools.UpdateWidgetColliderDepth(); call at the end of NormalizeDepths function). You might need to do that in other places below as well.