mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-18 02:50:32 +00:00
NetworkServer.DestroyObject: added comments
This commit is contained in:
parent
e9f8af40f9
commit
3232001466
@ -1228,18 +1228,17 @@ static void DestroyObject(NetworkIdentity identity, DestroyMode mode)
|
||||
|
||||
identity.connectionToClient?.RemoveOwnedObject(identity);
|
||||
|
||||
ObjectDestroyMessage message = new ObjectDestroyMessage
|
||||
{
|
||||
netId = identity.netId
|
||||
};
|
||||
SendToObservers(identity, message);
|
||||
|
||||
// send object destroy message to all observers, clear observers
|
||||
SendToObservers(identity, new ObjectDestroyMessage{netId = identity.netId});
|
||||
identity.ClearObservers();
|
||||
|
||||
// in host mode, call OnStopClient manually
|
||||
if (NetworkClient.active && localClientActive)
|
||||
{
|
||||
identity.OnStopClient();
|
||||
}
|
||||
|
||||
// we are on the server. call OnStopServer.
|
||||
identity.OnStopServer();
|
||||
|
||||
// are we supposed to GameObject.Destroy() it completely?
|
||||
|
Loading…
Reference in New Issue
Block a user