mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-18 02:50:32 +00:00
NetworkServer.SpawnObjects: use foreach in first loop
This commit is contained in:
parent
df7c66e4c7
commit
1418fb66b7
@ -1189,16 +1189,16 @@ public static bool SpawnObjects()
|
||||
return true;
|
||||
|
||||
NetworkIdentity[] identities = Resources.FindObjectsOfTypeAll<NetworkIdentity>();
|
||||
for (int i = 0; i < identities.Length; i++)
|
||||
foreach (NetworkIdentity identity in identities)
|
||||
{
|
||||
if (ValidateSceneObject(identity))
|
||||
{
|
||||
NetworkIdentity identity = identities[i];
|
||||
if (!ValidateSceneObject(identity))
|
||||
continue;
|
||||
|
||||
if (LogFilter.Debug) { Debug.Log("SpawnObjects sceneId:" + identity.sceneId + " name:" + identity.gameObject.name); }
|
||||
identity.Reset();
|
||||
identity.gameObject.SetActive(true);
|
||||
}
|
||||
}
|
||||
|
||||
for (int i = 0; i < identities.Length; i++)
|
||||
{
|
||||
NetworkIdentity identity = identities[i];
|
||||
|
Loading…
Reference in New Issue
Block a user