mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-18 19:10:32 +00:00
fix: NetworkServer.Spawn now activates inactive GameObjects (for example, in case they were previously Unspawned)
This commit is contained in:
parent
1e40999503
commit
7715ac700b
@ -1506,6 +1506,10 @@ static void SpawnObject(GameObject obj, NetworkConnection ownerConnection)
|
|||||||
if (ownerConnection is LocalConnectionToClient)
|
if (ownerConnection is LocalConnectionToClient)
|
||||||
identity.isOwned = true;
|
identity.isOwned = true;
|
||||||
|
|
||||||
|
// NetworkServer.Unspawn sets object as inactive.
|
||||||
|
// NetworkServer.Spawn needs to set them active again in case they were previously unspawned / inactive.
|
||||||
|
identity.gameObject.SetActive(true);
|
||||||
|
|
||||||
// only call OnStartServer if not spawned yet.
|
// only call OnStartServer if not spawned yet.
|
||||||
// check used to be in NetworkIdentity. may not be necessary anymore.
|
// check used to be in NetworkIdentity. may not be necessary anymore.
|
||||||
if (!identity.isServer && identity.netId == 0)
|
if (!identity.isServer && identity.netId == 0)
|
||||||
|
Loading…
Reference in New Issue
Block a user