Author Topic: Bug: 2D UI Events Inside Clipped Panels (3.6.1)  (Read 4532 times)

Simie

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 25
    • View Profile
Bug: 2D UI Events Inside Clipped Panels (3.6.1)
« 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)
« Last Edit: May 29, 2014, 02:46:48 PM by Simie »

mulova

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 14
    • View Profile
Re: Bug: 2D UI Events Inside Clipped Panels (3.6.1)
« Reply #1 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.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Bug: 2D UI Events Inside Clipped Panels (3.6.1)
« Reply #2 on: May 30, 2014, 02:13:44 PM »
This should be already fixed in 3.6.2.

Simie

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 25
    • View Profile
Re: Bug: 2D UI Events Inside Clipped Panels (3.6.1)
« Reply #3 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...

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Bug: 2D UI Events Inside Clipped Panels (3.6.1)
« Reply #4 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.

frarees

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 22
    • View Profile
Re: Bug: 2D UI Events Inside Clipped Panels (3.6.1)
« Reply #5 on: June 02, 2014, 04:49:43 AM »
I think I'm having the same issue.
I've reported it here.

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?)

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile