mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-18 02:50:32 +00:00
cleanup
This commit is contained in:
parent
5a9d7921c5
commit
9abc60c62b
@ -778,8 +778,8 @@ internal static void OnObjectSpawnFinished(ObjectSpawnFinishedMessage _)
|
||||
//Debug.Log("SpawnFinished");
|
||||
ClearNullFromSpawned();
|
||||
|
||||
// paul: Initialize the objects in the same order as they were initialized
|
||||
// in the server. This is important if spawned objects
|
||||
// paul: Initialize the objects in the same order as they were
|
||||
// initialized in the server. This is important if spawned objects
|
||||
// use data from scene objects
|
||||
foreach (NetworkIdentity identity in NetworkIdentity.spawned.Values.OrderBy(uv => uv.netId))
|
||||
{
|
||||
@ -793,8 +793,9 @@ internal static void OnObjectSpawnFinished(ObjectSpawnFinishedMessage _)
|
||||
static readonly List<uint> toRemoveFromSpawned = new List<uint>();
|
||||
static void ClearNullFromSpawned()
|
||||
{
|
||||
// spawned has null objects after changing scenes on client using NetworkManager.ServerChangeScene
|
||||
// remove them here so that 2nd loop below does not get NullReferenceException
|
||||
// spawned has null objects after changing scenes on client using
|
||||
// NetworkManager.ServerChangeScene remove them here so that 2nd
|
||||
// loop below does not get NullReferenceException
|
||||
// see https://github.com/vis2k/Mirror/pull/2240
|
||||
// TODO fix scene logic so that client scene doesn't have null objects
|
||||
foreach (KeyValuePair<uint, NetworkIdentity> kvp in NetworkIdentity.spawned)
|
||||
|
Loading…
Reference in New Issue
Block a user