mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-18 02:50:32 +00:00
breaking: InspectorHelper.IsSyncObject made universal as ImplementsInterface<T>
This commit is contained in:
parent
ab78c858da
commit
323b357a94
@ -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<T>(this FieldInfo field)
|
||||
{
|
||||
return typeof(SyncObject).IsAssignableFrom(field.FieldType);
|
||||
return typeof(T).IsAssignableFrom(field.FieldType);
|
||||
}
|
||||
|
||||
public static bool HasShowInInspector(this FieldInfo field)
|
||||
|
@ -31,7 +31,7 @@ public SyncObjectDrawer(UnityEngine.Object targetObject)
|
||||
syncObjectFields = new List<SyncObjectField>();
|
||||
foreach (FieldInfo field in InspectorHelper.GetAllFields(targetObject.GetType(), typeof(NetworkBehaviour)))
|
||||
{
|
||||
if (field.IsSyncObject() && field.IsVisibleSyncObject())
|
||||
if (field.ImplementsInterface<SyncObject>() && field.IsVisibleSyncObject())
|
||||
{
|
||||
syncObjectFields.Add(new SyncObjectField(field));
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user