This commit is contained in:
vis2k 2022-10-02 09:43:35 +07:00
parent 1b562c7b6a
commit 61295a5120
2 changed files with 10 additions and 4 deletions

View File

@ -900,7 +900,10 @@ internal static void ShowForConnection(NetworkIdentity identity, NetworkConnecti
internal static void HideForConnection(NetworkIdentity identity, NetworkConnection conn) internal static void HideForConnection(NetworkIdentity identity, NetworkConnection conn)
{ {
ObjectHideMessage msg = new ObjectHideMessage {netId = identity.netId}; ObjectHideMessage msg = new ObjectHideMessage
{
netId = identity.netId
};
conn.Send(msg); conn.Send(msg);
} }
@ -1321,7 +1324,10 @@ static void DestroyObject(NetworkIdentity identity, DestroyMode mode)
identity.connectionToClient?.RemoveOwnedObject(identity); identity.connectionToClient?.RemoveOwnedObject(identity);
// send object destroy message to all observers, clear observers // send object destroy message to all observers, clear observers
SendToObservers(identity, new ObjectDestroyMessage {netId = identity.netId}); SendToObservers(identity, new ObjectDestroyMessage
{
netId = identity.netId
});
identity.ClearObservers(); identity.ClearObservers();
// in host mode, call OnStopClient/OnStopLocalPlayer manually // in host mode, call OnStopClient/OnStopLocalPlayer manually