RebuildObservers() public method

This causes the set of players that can see this object to be rebuild. The OnRebuildObservers callback function will be invoked on each NetworkBehaviour.

public RebuildObservers ( bool initialize ) : void
initialize bool True if this is the first time.
return void
コード例 #1
0
 private bool SetupLocalPlayerForConnection(NetworkConnection conn, NetworkIdentity uv, PlayerController newPlayerController)
 {
     if (LogFilter.logDev)
     Debug.Log((object) ("NetworkServer SetupLocalPlayerForConnection netID:" + (object) uv.netId));
       ULocalConnectionToClient connectionToClient = conn as ULocalConnectionToClient;
       if (connectionToClient == null)
     return false;
       if (LogFilter.logDev)
     Debug.Log((object) "NetworkServer AddPlayer handling ULocalConnectionToClient");
       if (uv.netId.IsEmpty())
     uv.OnStartServer();
       uv.RebuildObservers(true);
       this.SendSpawnMessage(uv, (NetworkConnection) null);
       connectionToClient.localClient.AddLocalPlayer(newPlayerController);
       uv.SetLocalPlayer(newPlayerController.playerControllerId);
       return true;
 }