mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-18 11:00: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;
|
return true;
|
||||||
|
|
||||||
NetworkIdentity[] identities = Resources.FindObjectsOfTypeAll<NetworkIdentity>();
|
NetworkIdentity[] identities = Resources.FindObjectsOfTypeAll<NetworkIdentity>();
|
||||||
for (int i = 0; i < identities.Length; i++)
|
foreach (NetworkIdentity identity in identities)
|
||||||
{
|
{
|
||||||
NetworkIdentity identity = identities[i];
|
if (ValidateSceneObject(identity))
|
||||||
if (!ValidateSceneObject(identity))
|
{
|
||||||
continue;
|
if (LogFilter.Debug) { Debug.Log("SpawnObjects sceneId:" + identity.sceneId + " name:" + identity.gameObject.name); }
|
||||||
|
identity.Reset();
|
||||||
if (LogFilter.Debug) { Debug.Log("SpawnObjects sceneId:" + identity.sceneId + " name:" + identity.gameObject.name); }
|
identity.gameObject.SetActive(true);
|
||||||
identity.Reset();
|
}
|
||||||
identity.gameObject.SetActive(true);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int i = 0; i < identities.Length; i++)
|
for (int i = 0; i < identities.Length; i++)
|
||||||
{
|
{
|
||||||
NetworkIdentity identity = identities[i];
|
NetworkIdentity identity = identities[i];
|
||||||
|
Loading…
Reference in New Issue
Block a user