Author Topic: [WP8] NGUI acting differently than on android than WP8  (Read 1461 times)

Ombra

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 1
    • View Profile
[WP8] NGUI acting differently than on android than WP8
« on: June 19, 2014, 02:18:07 PM »
Hello,
I've been trying to build my project to windows phone after testing it on android. It works as expected on android, but on windows phone the buttons seem to be unresponsive. They have the up/hover/down state but the events that are tied to them don't seem to do anything. With the debug enabled, it shows that they are being hit by the raycasting. I'm not sure what I'm doing wrong, is there anything specific that I need to do to get it to work on this platform? I have tried building a baisc scene with just a single button that loads a new scene, but no luck.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: [WP8] NGUI acting differently than on android than WP8
« Reply #1 on: June 19, 2014, 06:46:10 PM »
Likely related to a typo in EventDelegate.cs. Around line 361, the section has a "if (mMethod == null) break;" when in fact it should be "if (mMethod != null) break;"

Here's the whole "for" statement from the latest Pro repository for your convenience.
  1.                                 for (mMethod = null; type != null; )
  2.                                 {
  3.                                         try
  4.                                         {
  5.                                                 mMethod = type.GetMethod(mMethodName, BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Public);
  6.                                                 if (mMethod != null) break;
  7.                                         }
  8.                                         catch (System.Exception) { }
  9.   #if UNITY_WP8
  10.                                         // For some odd reason Type.GetMethod(name, bindingFlags) doesn't seem to work on WP8...
  11.                                         try
  12.                                         {
  13.                                                 mMethod = type.GetMethod(mMethodName);
  14.                                                 if (mMethod != null) break;
  15.                                         }
  16.                                         catch (System.Exception) { }
  17.   #endif
  18.                                         type = type.BaseType;
  19.                                 }