Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ public static void BroadcastProperty(this GameObject go, CustomProperty property
continue;
}

// Finally, look for public fields
// Finally, look for fields
var csfield = FindFieldBySignature(comp, property.m_Name, objValue.GetType());
if (csfield != null)
{
Expand All @@ -185,7 +185,7 @@ public static void BroadcastProperty(this GameObject go, CustomProperty property

private static MethodInfo FindMethodBySignature(MonoBehaviour component, string name, Type paramType)
{
return component.GetType().GetMethods(BindingFlags.Instance | BindingFlags.Public).Where(info =>
return component.GetType().GetMethods(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic).Where(info =>
{
// Name must match
if (info.Name != name)
Expand Down Expand Up @@ -218,8 +218,7 @@ private static MethodInfo FindMethodBySignature(MonoBehaviour component, string

private static PropertyInfo FindPropertyBySignature(MonoBehaviour component, string name, Type valueType)
{
// Property must be public and instanced and writable
return component.GetType().GetProperties(BindingFlags.Instance | BindingFlags.Public).Where(
return component.GetType().GetProperties(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic).Where(
info =>
info.CanWrite &&
info.Name == name &&
Expand All @@ -229,7 +228,7 @@ private static PropertyInfo FindPropertyBySignature(MonoBehaviour component, str

private static FieldInfo FindFieldBySignature(MonoBehaviour component, string name, Type valueType)
{
return component.GetType().GetFields(BindingFlags.Instance | BindingFlags.Public).Where(
return component.GetType().GetFields(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic).Where(
info =>
!info.IsInitOnly &&
info.Name == name &&
Expand Down