Author Topic: OnClicks not getting called on list items in 2 Camera Scroll View  (Read 8913 times)

quitebuttery

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 18
    • View Profile
So I took the camera scroll view example, changed it to vertical and now I don't get any OnClicks on my list items.  It actually works in all my old games, but for this new project clicks are not coming through.  How do I diagnose this?  The only thing I did was replace the list items with my own objects.  But they have collision boxes on them and a script with OnClick.  I don't get it.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: OnClicks not getting called on list items in 2 Camera Scroll View
« Reply #1 on: June 21, 2012, 10:56:35 PM »
There was a video that converted a horizontal clipping area to a vertical one: http://www.tasharen.com/ngui/dragdrop/

quitebuttery

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 18
    • View Profile
Re: OnClicks not getting called on list items in 2 Camera Scroll View
« Reply #2 on: June 22, 2012, 03:12:21 AM »
Hmm, that example doesn't match up to what you have in the 2-camera setup scene.  As clipping is set to "none" on the panel with the list elements attached.

quitebuttery

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 18
    • View Profile
Re: OnClicks not getting called on list items in 2 Camera Scroll View
« Reply #3 on: June 22, 2012, 03:25:09 AM »
Also, I tried adding clipping and set it to fit the window to no avail.  OnClick still never gets called.

PhilipC

  • Guest
Re: OnClicks not getting called on list items in 2 Camera Scroll View
« Reply #4 on: June 22, 2012, 09:47:25 AM »
Are you still getting other functions like OnHover? I just made the example vertical instead and i still receive the events. I would double check your colliders.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: OnClicks not getting called on list items in 2 Camera Scroll View
« Reply #5 on: June 22, 2012, 11:02:35 AM »
Oh you're using the dual camera approach... yeah just check your colliders. When in doubt, add a Debug.Log to UICamera that will print what was hit in the raycast function.

quitebuttery

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 18
    • View Profile
Re: OnClicks not getting called on list items in 2 Camera Scroll View
« Reply #6 on: June 22, 2012, 01:22:37 PM »
Yep, colliders are all there and look fine.  No OnClicks on them.  I have no idea what happened. I'll probably end up just going back to the test scene and re-making it AGAIN.  Does it matter where the actual list items are in the scene z-wise?  They are in front of the background, but not where they were in the example scene.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: OnClicks not getting called on list items in 2 Camera Scroll View
« Reply #7 on: June 22, 2012, 05:44:54 PM »
Check your second UICamera's event mask. My guess is that it doesn't match the mask of what the camera sees.

quitebuttery

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 18
    • View Profile
Re: OnClicks not getting called on list items in 2 Camera Scroll View
« Reply #8 on: June 22, 2012, 05:54:40 PM »
Well I just re-built it using the example again and it works.  I dunno.  My biggest problem with NGUI is the giant rube goldberg machine of gameobjects that scrollviews etc. use.  It's really hard to debug stuff like this because of the zillion objects with scripts attached to various ones that all have a zillion inspector elements to tweak.

it would be cool if there was somehow a simpler template you could use to create horizontal and vertical lists etc.  Something like the widget maker, perhaps, but it creates a few common view types.