Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: Simie on May 29, 2014, 02:16:11 PM

Title: Bug: 2D UI Events Inside Clipped Panels (3.6.1)
Post by: Simie on May 29, 2014, 02:16:11 PM
When using the 2D UI event mode I found a bug where widgets inside a clipped panel had their events filtered out by the IsVisible check on the clipped panel. It was using the raycast world pos, which was 0,0,0 for some reason.

I changed line 742 of UICamera.cs from
  1. if (IsVisible(ref mHits.buffer[b]))
to
  1. if (IsVisible(lastWorldPosition, mHits[b].go))
and that fixed it.


EDIT: In fact, I'm encountering a lot of other issues with 2D colliders. One is that below a certain size the collider no longer gets hit by raycasts (I assume there is some minimum size that Unity is disabling the collider at)
Title: Re: Bug: 2D UI Events Inside Clipped Panels (3.6.1)
Post by: mulova on May 29, 2014, 11:20:03 PM
After 'switching to 2D collider', UIPopupList doesn't respond to the mouse hover and click.
But the patch fixes it.
Title: Re: Bug: 2D UI Events Inside Clipped Panels (3.6.1)
Post by: ArenMook on May 30, 2014, 02:13:44 PM
This should be already fixed in 3.6.2.
Title: Re: Bug: 2D UI Events Inside Clipped Panels (3.6.1)
Post by: Simie on May 31, 2014, 03:41:24 PM
Not fixed in 3.6.2. Colliders inside clipped panels don't receive events. The colliders do receive events when setting the same panel to "Constrain but don't clip". It doesn't seem like there were any changes to UICamera.cs at all in 3.6.2...
Title: Re: Bug: 2D UI Events Inside Clipped Panels (3.6.1)
Post by: ArenMook on June 01, 2014, 05:06:03 PM
How do I reproduce the issue you're talking about? I tried this:

1. New scene.
2. Created a scroll view.
3. Added content to this scroll view (just a bunch of sprites with colliders and Drag Scroll View scripts attached).
4. Works as expected. Switched to 2D colliders via the NGUI menu -- still works as expected.
Title: Re: Bug: 2D UI Events Inside Clipped Panels (3.6.1)
Post by: frarees on June 02, 2014, 04:49:43 AM
I think I'm having the same issue.
I've reported it here (http://www.tasharen.com/forum/index.php?topic=9763.0).

As Simie says it does happen only when Soft Clipping. I have to say that with the exactly same configuration it was working last week. Might sound like black magic, but today is just not responding. No change AFAIK (maybe some ExecuteInEditMode or similar is caching and serializing stuff not properly at editor time, sometimes?)
Title: Re: Bug: 2D UI Events Inside Clipped Panels (3.6.1)
Post by: ArenMook on June 02, 2014, 10:42:30 PM
Maybe this: http://www.tasharen.com/forum/index.php?topic=9766.0