mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-18 11:00:32 +00:00
* fix: calling unspawn on scene objects in DestroyOwnedObjects fixes: https://github.com/MirrorNetworking/Mirror/issues/3538 * Update NetworkConnectionToClient.cs --------- Co-authored-by: mischa <16416509+vis2k@users.noreply.github.com>
This commit is contained in:
parent
51c7162af7
commit
08fa0269de
@ -248,6 +248,11 @@ internal void DestroyOwnedObjects()
|
|||||||
{
|
{
|
||||||
if (netIdentity != null)
|
if (netIdentity != null)
|
||||||
{
|
{
|
||||||
|
// unspawn scene objects, destroy instantiated objects.
|
||||||
|
// fixes: https://github.com/MirrorNetworking/Mirror/issues/3538
|
||||||
|
if (netIdentity.sceneId != 0)
|
||||||
|
NetworkServer.UnSpawn(netIdentity.gameObject);
|
||||||
|
else
|
||||||
NetworkServer.Destroy(netIdentity.gameObject);
|
NetworkServer.Destroy(netIdentity.gameObject);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user