Example #1
0
 // helper function to trigger a full rebuild.
 // most implementations should call this in a certain interval.
 // some might call this all the time, or only on team changes or
 // scene changes and so on.
 //
 // IMPORTANT: check if NetworkServer.active when using Update()!
 protected void RebuildAll()
 {
     foreach (NetworkIdentity identity in NetworkServer.spawned.Values)
     {
         NetworkServer.RebuildObservers(identity, false);
     }
 }
 void RebuildMatchObservers(Guid matchId)
 {
     foreach (NetworkIdentity netIdentity in matchObjects[matchId])
     {
         if (netIdentity != null)
         {
             NetworkServer.RebuildObservers(netIdentity, false);
         }
     }
 }
 void RebuildSceneObservers(Scene scene)
 {
     foreach (NetworkIdentity netIdentity in sceneObjects[scene])
     {
         if (netIdentity != null)
         {
             NetworkServer.RebuildObservers(netIdentity, false);
         }
     }
 }
 void RebuildTeamObservers(string teamId)
 {
     foreach (NetworkIdentity netIdentity in teamObjects[teamId])
     {
         if (netIdentity != null)
         {
             NetworkServer.RebuildObservers(netIdentity, false);
         }
     }
 }