Author Topic: ON NGUI Button problem  (Read 4095 times)

hisashipong

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 12
    • View Profile
ON NGUI Button problem
« on: November 28, 2012, 12:53:42 PM »
i have used ngui to make the button

        void OnClick(){   
      Debug.Log("OnClicked");
      clickedBtn();
   }
   
   void clickedBtn(){
      Debug.Log("click");
   }

here is my script, but funny that when i use mouse click , it just detect once click , it's good
but when i use unity remote to click it , it will detect twice click

anyone have the same question with me? or i have do sth wrong?
hope someone can help me  thx very much~

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: ON NGUI Button problem
« Reply #1 on: November 29, 2012, 08:06:04 AM »
Search for "Unity Remote" on this forum, and you will find many questions like these.

Unity Remote sends both mouse and touch events for the same action, which is why you have duplicates.

Uncheck "use mouse" on UICamera.

hisashipong

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 12
    • View Profile
Re: ON NGUI Button problem
« Reply #2 on: November 29, 2012, 09:01:01 AM »
thx so much