doc(MatchInterestManagement): comments

This commit is contained in:
MrGadget1024 2024-01-04 13:58:25 -05:00
parent 0c46045130
commit 5b65afd68d

View File

@ -106,7 +106,7 @@ public override void OnSpawned(NetworkIdentity identity)
[ServerCallback]
public override void OnDestroyed(NetworkIdentity identity)
{
// Don't RebuildSceneObservers here - that will happen in Update.
// Don't RebuildSceneObservers here - that will happen in LateUpdate.
// Multiple objects could be destroyed in same frame and we don't
// want to rebuild for each one...let LateUpdate do it once.
// We must add the current match to dirtyMatches for LateUpdate to rebuild it.
@ -151,6 +151,7 @@ public override void OnRebuildObservers(NetworkIdentity identity, HashSet<Networ
if (networkMatch.matchId == Guid.Empty)
return;
// Abort if this match hasn't been created yet by OnSpawned or OnMatchChanged
if (!matchObjects.TryGetValue(networkMatch.matchId, out HashSet<NetworkMatch> objects))
return;