diff --git a/Assets/Mirror/Editor/InspectorHelper.cs b/Assets/Mirror/Editor/InspectorHelper.cs index 60a9ee4cc..f3806978e 100644 --- a/Assets/Mirror/Editor/InspectorHelper.cs +++ b/Assets/Mirror/Editor/InspectorHelper.cs @@ -57,9 +57,9 @@ public static bool IsVisibleField(this FieldInfo field) return field.IsPublic || IsSerializeField(field); } - public static bool IsSyncObject(this FieldInfo field) + public static bool ImplementsInterface(this FieldInfo field) { - return typeof(SyncObject).IsAssignableFrom(field.FieldType); + return typeof(T).IsAssignableFrom(field.FieldType); } public static bool HasShowInInspector(this FieldInfo field) diff --git a/Assets/Mirror/Editor/SyncObjectDrawer.cs b/Assets/Mirror/Editor/SyncObjectDrawer.cs index 6ab078d4a..97fbe0355 100644 --- a/Assets/Mirror/Editor/SyncObjectDrawer.cs +++ b/Assets/Mirror/Editor/SyncObjectDrawer.cs @@ -31,7 +31,7 @@ public SyncObjectDrawer(UnityEngine.Object targetObject) syncObjectFields = new List(); foreach (FieldInfo field in InspectorHelper.GetAllFields(targetObject.GetType(), typeof(NetworkBehaviour))) { - if (field.IsSyncObject() && field.IsVisibleSyncObject()) + if (field.ImplementsInterface() && field.IsVisibleSyncObject()) { syncObjectFields.Add(new SyncObjectField(field)); }