Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: KChandra on June 26, 2017, 08:04:37 AM

Title: UiCamera.hoveredObject after clicking on ScrollBar
Post by: KChandra on June 26, 2017, 08:04:37 AM
Hi,

I'm using OnSelect() to detect if there is a mouse click outside a popup then to close it.

  1.  void OnSelect(bool isSelected)
  2.         {
  3.             if (!isSelected && (UICamera.hoveredObject == null || UICamera.hoveredObject.tag != "FilterPopup"))
  4.             {
  5.                 HideView();
  6.             }
  7.         }
  8.  

This works great however, in the popup there is a scrollbar, and when we click on the scrollbar, and click somewhere else on the ui, it looks like UICamera.hoveredObject is still on the scrollbar.
Any help will be much appreciated. I've also tried using selectedObject but its still getting the scrollbarobject when clicking something else on the ui
Title: Re: UiCamera.hoveredObject after clicking on ScrollBar
Post by: KChandra on June 26, 2017, 02:41:36 PM
Ah apologies.. used UICamera.onSelect and its fine :)