Fixed potential issue when destroying objects
This commit is contained in:
parent
4b8b88d550
commit
17a594ee98
@ -77,10 +77,13 @@ namespace MLAPI.NetworkingManagerComponents.Core
|
|||||||
|
|
||||||
internal static void DestroyNonSceneObjects()
|
internal static void DestroyNonSceneObjects()
|
||||||
{
|
{
|
||||||
foreach (KeyValuePair<uint, NetworkedObject> netObject in spawnedObjects)
|
if(spawnedObjects != null)
|
||||||
{
|
{
|
||||||
if (!netObject.Value.sceneObject)
|
foreach (KeyValuePair<uint, NetworkedObject> netObject in spawnedObjects)
|
||||||
MonoBehaviour.Destroy(netObject.Value.gameObject);
|
{
|
||||||
|
if (!netObject.Value.sceneObject)
|
||||||
|
MonoBehaviour.Destroy(netObject.Value.gameObject);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user