#if !UNITY_EDITOR && UNITY_WP8
static string GetMethodName (Callback callback)
{
System.Delegate d = callback as System.Delegate;
return d.Method.Name;
}
static bool IsValid (Callback callback)
{
System.Delegate d = callback as System.Delegate;
return d != null && d.Method != null;
}
#elif !UNITY_EDITOR && UNITY_METRO
static string GetMethodName (Callback callback)
{
System.Delegate d = callback as System.Delegate;
return d.GetMethodInfo().Name;
}
static bool IsValid (Callback callback)
{
System.Delegate d = callback as System.Delegate;
return d != null && d.GetMethodInfo() != null;
}
#else
// Perhaps it can be improved by merging this with the first #if
// I will let you try that ;)
static string GetMethodName (Callback callback) { return callback.Method.Name; }
static bool IsValid (Callback callback) { return callback != null && callback.Method != null; }
#endif