Skip to content

Instantly share code, notes, and snippets.

@wcoastsands
Last active October 11, 2017 22:44
Show Gist options
  • Save wcoastsands/63af6c88c0e1f11c6127e945e0e0581f to your computer and use it in GitHub Desktop.
Save wcoastsands/63af6c88c0e1f11c6127e945e0e0581f to your computer and use it in GitHub Desktop.
#if NETFX_CORE // Workaround to support changes in the .Net reflection API for Windows Store Apps
using System;
using System.Reflection;
namespace UnityEngine.Analytics.Experimental.Tracker
{
public static class TypeExtensions
{
public static PropertyInfo GetProperty(this Type type, string propertyName)
{
return type.GetTypeInfo().GetDeclaredProperty(propertyName);
}
public static FieldInfo GetField(this Type type, string fieldName)
{
return type.GetTypeInfo().GetDeclaredField(fieldName);
}
}
}
#endif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment