Skip to content

Instantly share code, notes, and snippets.

@fuqunaga
Created February 12, 2015 07:59
Show Gist options
  • Save fuqunaga/c04e75c28f12ae39b129 to your computer and use it in GitHub Desktop.
Save fuqunaga/c04e75c28f12ae39b129 to your computer and use it in GitHub Desktop.
Type GetPropertyType(SerializedProperty property)
{
var paths = property.propertyPath.Split('.');
var target = property.serializedObject.targetObject as object;
return paths.Aggregate(target, (t, path) => t.GetType().GetField(path).GetValue(t)).GetType();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment