mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-18 11:00:32 +00:00
Use actual type instead of var. And consistent naming.
This commit is contained in:
parent
49be1cc588
commit
a57e23ea60
@ -59,7 +59,7 @@ void Init(MonoScript script)
|
|||||||
Type scriptClass = script.GetClass();
|
Type scriptClass = script.GetClass();
|
||||||
|
|
||||||
// find public SyncVars to show (user doesn't want protected ones to be shown in inspector)
|
// find public SyncVars to show (user doesn't want protected ones to be shown in inspector)
|
||||||
foreach (var field in scriptClass.GetFields(BindingFlags.Public | BindingFlags.Instance))
|
foreach (FieldInfo field in scriptClass.GetFields(BindingFlags.Public | BindingFlags.Instance))
|
||||||
{
|
{
|
||||||
Attribute[] fieldMarkers = (Attribute[])field.GetCustomAttributes(typeof(SyncVarAttribute), true);
|
Attribute[] fieldMarkers = (Attribute[])field.GetCustomAttributes(typeof(SyncVarAttribute), true);
|
||||||
if (fieldMarkers.Length > 0)
|
if (fieldMarkers.Length > 0)
|
||||||
@ -69,9 +69,9 @@ void Init(MonoScript script)
|
|||||||
}
|
}
|
||||||
|
|
||||||
int numSyncLists = 0;
|
int numSyncLists = 0;
|
||||||
foreach (var f in serializedObject.targetObject.GetType().GetFields())
|
foreach (FieldInfo field in serializedObject.targetObject.GetType().GetFields())
|
||||||
{
|
{
|
||||||
if (f.FieldType.BaseType != null && f.FieldType.BaseType.Name.Contains("SyncList"))
|
if (field.FieldType.BaseType != null && field.FieldType.BaseType.Name.Contains("SyncList"))
|
||||||
{
|
{
|
||||||
numSyncLists += 1;
|
numSyncLists += 1;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user