Fixed potential issue when destroying objects
This commit is contained in:
parent
4b8b88d550
commit
17a594ee98
@ -76,6 +76,8 @@ namespace MLAPI.NetworkingManagerComponents.Core
|
|||||||
}
|
}
|
||||||
|
|
||||||
internal static void DestroyNonSceneObjects()
|
internal static void DestroyNonSceneObjects()
|
||||||
|
{
|
||||||
|
if(spawnedObjects != null)
|
||||||
{
|
{
|
||||||
foreach (KeyValuePair<uint, NetworkedObject> netObject in spawnedObjects)
|
foreach (KeyValuePair<uint, NetworkedObject> netObject in spawnedObjects)
|
||||||
{
|
{
|
||||||
@ -83,6 +85,7 @@ namespace MLAPI.NetworkingManagerComponents.Core
|
|||||||
MonoBehaviour.Destroy(netObject.Value.gameObject);
|
MonoBehaviour.Destroy(netObject.Value.gameObject);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
internal static GameObject SpawnObject(int spawnablePrefabIndex, uint networkId, int ownerId, Vector3 position, Quaternion rotation)
|
internal static GameObject SpawnObject(int spawnablePrefabIndex, uint networkId, int ownerId, Vector3 position, Quaternion rotation)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user