Optimized SyncedVarInit
This commit is contained in:
parent
e1cc0b6fbd
commit
0572ab1b13
@ -211,6 +211,8 @@ namespace MLAPI.MonoBehaviours.Core
|
||||
private bool[] dirtyFields;
|
||||
internal void SyncVarInit()
|
||||
{
|
||||
if (syncVarInit)
|
||||
return;
|
||||
syncVarInit = true;
|
||||
FieldInfo[] sortedFields = GetType().GetFields(BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.FlattenHierarchy | BindingFlags.Instance).OrderBy(x => x.Name).ToArray();
|
||||
for (byte i = 0; i < sortedFields.Length; i++)
|
||||
|
@ -186,6 +186,7 @@ namespace MLAPI.MonoBehaviours.Core
|
||||
{
|
||||
childNetworkedBehaviours[i].NetworkStart();
|
||||
childNetworkedBehaviours[i].SyncVarInit();
|
||||
childNetworkedBehaviours[i].networkedStartInvoked = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user