Author Topic: UiCamera.hoveredObject after clicking on ScrollBar  (Read 3163 times)

KChandra

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 5
    • View Profile
UiCamera.hoveredObject after clicking on ScrollBar
« 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

KChandra

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 5
    • View Profile
Re: UiCamera.hoveredObject after clicking on ScrollBar
« Reply #1 on: June 26, 2017, 02:41:36 PM »
Ah apologies.. used UICamera.onSelect and its fine :)