Author Topic: NGUI 3.0.2 Compilation Issue on Win8 & WP8 with Unity 4.3 beta  (Read 3142 times)

liu_yin_

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 11
    • View Profile
NGUI 3.0.2 Compilation Issue on Win8 & WP8 with Unity 4.3 beta
« on: October 21, 2013, 01:51:29 AM »
I was playing NGUI 3.0.2 with Unity 4.3 beta build and found 3 compilation issues with the following code snippet in EventDelegate.cs on Win8 & WP8 build.

#if (!UNITY_EDITOR) && UNITY_METRO
   static string GetMethodName (Callback callback)
   {
      Delegate d = callback as Delegate;
      return d.GetMethodInfo().Name;
   }

1. WP8 supports Callback.Method, but it doesn't support the GetMethodInfo extension method. Therefore, the above conditional compilation causes the 1st error on WP8. I would suggest change it to  (!UNITY_EDITOR) && UNITY_METRO.
2. The "Delegate" type above belongs to System namespace, but it's not referenced in this file, and causes the 2nd compilation error in both WP8 and Win8 builds. Adding "using System" fixes it.
3. The GetMethodInfo extension method requires System.Reflection namespace, but it isn't referenced in Win8 build due to the following conditional compilation, and causes the 3rd error on Win8. I would suggest to change #if REFLECTION_SUPPORT to #if REFLECTION_SUPPORT || UNITY_METRO to fix it.

#if UNITY_EDITOR || (!UNITY_FLASH && !UNITY_WP8 && !UNITY_METRO)
#define REFLECTION_SUPPORT
#endif

#if REFLECTION_SUPPORT
using System.Reflection;
#endif

I have verified those fix in my local build. Hopefully you can include it in 3.0.3 so that I don't need to reapply my fix when I upgrade to it.

Thanks!

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: NGUI 3.0.2 Compilation Issue on Win8 & WP8 with Unity 4.3 beta
« Reply #1 on: October 21, 2013, 01:11:29 PM »
Known issue, already fixed in 3.0.3.