Update NetworkIdentity.cs

checking cache instead of property
This commit is contained in:
James Frowen 2020-10-11 22:45:48 +01:00 committed by vis2k
parent fb13773f5d
commit 08585c7379

View File

@ -242,7 +242,7 @@ public NetworkBehaviour[] NetworkBehaviours
void CreateNetworkBehavioursCache() void CreateNetworkBehavioursCache()
{ {
networkBehavioursCache = GetComponents<NetworkBehaviour>(); networkBehavioursCache = GetComponents<NetworkBehaviour>();
if (NetworkBehaviours.Length > 64) if (networkBehavioursCache.Length > 64)
{ {
Debug.LogError($"Only 64 NetworkBehaviour components are allowed for NetworkIdentity: {name} because of the dirtyComponentMask", this); Debug.LogError($"Only 64 NetworkBehaviour components are allowed for NetworkIdentity: {name} because of the dirtyComponentMask", this);
// Log error once then resize array so that NetworkIdentity does not throw exceptions later // Log error once then resize array so that NetworkIdentity does not throw exceptions later