Author Topic: "OnClick" optimization  (Read 2930 times)

ddfire

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 32
    • View Profile
"OnClick" optimization
« on: December 27, 2012, 11:04:14 AM »
Hi,
I made a small keyboard to use, uiInput didnt work for me....
i have a problem, if the user type "too fast" the order of the messages is messed...
maybe a solution could be instead of send a message a direct call in UICamera maybe adding an interface or getting the uibuttonmessage... that will reduce the messages to half... because uibuttonmessage then send one more message...  adding more delays...
maybe uibuttonmessage could have a delegated method for onclick  onpress etc... that will make the code much faster...


ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: "OnClick" optimization
« Reply #1 on: December 27, 2012, 12:09:26 PM »
SendMessage is not that slow. Last I checked you can have hundreds of them in a single millisecond. I'd suggest looking closer at your own custom code. There is certainly no reason that the order events come in at would ever be messed up. They are all queued internally in Unity, so the order is always guaranteed to be correct.

ddfire

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 32
    • View Profile
Re: "OnClick" optimization
« Reply #2 on: December 27, 2012, 12:10:23 PM »
Any suggestions on how i can check that?
Thanks!!!

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: "OnClick" optimization
« Reply #3 on: December 27, 2012, 12:12:26 PM »
Check what? Your code? Debug.Logs all the way, I would say. :)