Author Topic: How to detect if mouse is clicking on NGUI area?  (Read 75304 times)

SamK

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 13
    • View Profile
Re: How to detect if mouse is clicking on NGUI area?
« Reply #45 on: December 09, 2014, 12:58:18 AM »
OK will try this .. Is this isOverUI property in the latest version im on 3.68 but  cant find it. I can update to the newer version though.
Hope this works. and if isOverUI is triggered when the the cursor is overUI it think it can work for the editor but how would it work on touch devices ? 

SamK

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 13
    • View Profile
Re: How to detect if mouse is clicking on NGUI area?
« Reply #46 on: December 09, 2014, 05:41:27 AM »
Ok i did this. moved the UI towrds the screen -z
  1. if (Physics.Raycast(ray, out hit, Mathf.Infinity,1<<LayerMask.NameToLayer( "UI" )))
  2. MyFunction();
  3.  

I already tried this but The UI was behind other objects thats why it didnt worked earlier.
Too damn basic  :P