Hello Guest

Author Topic: button doesn't work in unity3d 4.2  (Read 4687 times)

timchiang

  • Newbie
  • *
  • Posts: 3
    • View Profile
button doesn't work in unity3d 4.2
« on: July 25, 2013, 06:36:57 am »
I upgrade unity to 4.2 , then the button can not click any more in unity editor . my 2dtoolkit version is 1.92.
Can any body help?

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: button doesn't work in unity3d 4.2
« Reply #1 on: July 25, 2013, 11:44:04 am »
Please refer to this here:
http://unikronsoftware.com/2dtoolkit/forum/index.php/topic,1682.msg10936.html#msg10936

Unity 4.2 broke the button, because they incorrectly say everything supports multitouch even though it doesnt.

PaulForest

  • Newbie
  • *
  • Posts: 1
    • View Profile
    • Homepage
Re: button doesn't work in unity3d 4.2
« Reply #2 on: July 25, 2013, 04:49:21 pm »
Hi guys,

We ran into the same issue, and we were able to track down the source of the problem. 

The issue is that in Unity < 4.2, Input.multiTouchEnabled returned false in the Unity editor.  Now it returns true.

The workaround is to use preprocessor conditionals.

So change:

#if !UNITY_FLASH
         if (Input.multiTouchEnabled)
...

to

#if !UNITY_FLASH && !(UNITY_EDITOR || UNITY || UNITY_STANDALONE_OSX || UNITY_DASHBOARD_WIDGET || UNITY_STANDALONE_WIN  || UNITY_STANDALONE_LINUX)
...

Will email the fixed file to your support email. 

Thanks again for a great product, guys!

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: button doesn't work in unity3d 4.2
« Reply #3 on: July 25, 2013, 06:17:21 pm »
Thanks Paul :)