Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: richardwood on September 04, 2014, 05:52:18 AM

Title: how to detect right click on ngui object
Post by: richardwood on September 04, 2014, 05:52:18 AM
hey, how do you detect if user performs right click on my scrollview items? at the moment I'm using this

  1.     public void OnClick()
  2.     {
  3.         if (Input.GetMouseButton(1))
  4.         {
  5.             Debug.Log("Right click on" + thisDisplayname);
  6.         }
  7.         Debug.Log(thisDisplayname);
  8.     }
  9.  

When I left click on my item it works fine, but it doesnt detect my right click, I also browsed somewhere and tried OnRightClick, but it doesnt trigger my debug log
Title: Re: how to detect right click on ngui object
Post by: ArenMook on September 04, 2014, 10:57:16 AM
Get rid of the Input.GetMouseButton line and replace it with "if (UICamera.currentTouchID == -1)".
Title: Re: how to detect right click on ngui object
Post by: petrucio on October 23, 2014, 03:35:57 PM
== -2