Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: rganeyev on October 19, 2012, 05:09:34 AM

Title: [Fixed]Buttons on scrollview are calling OnClick just once
Post by: rganeyev on October 19, 2012, 05:09:34 AM
I've implemented scroll view with buttons inside but has problem that buttons' OnClick are called just once. It's really strange. After that I've tested on Quest Log example and had the same effect!

I've opened Quest Log example and attached to SlicedSprite(which contains boxcollider and does tweening) my script:
  1. using UnityEngine;
  2.  
  3. public class TestButton : MonoBehaviour {
  4.      private void OnClick() {
  5.         Debug.Log("Test");
  6.     }
  7. }
  8.  

While running when I click that sprite, I get my Debug message, but just once. In other clicks on that sprite nothing happens.
How to deal with that? And why tweening works, but my code doesn't?

Thanks.

Title: Re: Buttons on scrollview are calling OnClick just once
Post by: Nicki on October 19, 2012, 09:20:31 AM
Try turning on gizmos and see if your colliders are running off or something.
Title: Re: Buttons on scrollview are calling OnClick just once
Post by: ArenMook on October 19, 2012, 10:12:45 AM
Check your Console log and turn off "Collapse" option.
Title: Re: Buttons on scrollview are calling OnClick just once
Post by: rganeyev on October 21, 2012, 12:25:09 AM
upps, sorry, what a stupid mistake!

Thank you!