UnityEngine.Networking.NetworkLobbyPlayer.OnClientReady C# (CSharp) Method

OnClientReady() public method

This is a hook that is invoked on clients when a LobbyPlayer switches between ready or not ready.

public OnClientReady ( bool readyState ) : void
readyState bool Whether the player is ready or not.
return void
        public virtual void OnClientReady(bool readyState)
        {
        }

Usage Example

Example #1
0
 private void OnClientReadyToBegin(NetworkMessage netMsg)
 {
     netMsg.ReadMessage <LobbyReadyToBeginMessage>(NetworkLobbyManager.s_LobbyReadyToBeginMessage);
     if ((int)NetworkLobbyManager.s_LobbyReadyToBeginMessage.slotId >= this.lobbySlots.Count <NetworkLobbyPlayer>())
     {
         if (LogFilter.logError)
         {
             Debug.LogError("NetworkLobbyManager OnClientReadyToBegin invalid lobby slot " + NetworkLobbyManager.s_LobbyReadyToBeginMessage.slotId);
         }
     }
     else
     {
         NetworkLobbyPlayer networkLobbyPlayer = this.lobbySlots[(int)NetworkLobbyManager.s_LobbyReadyToBeginMessage.slotId];
         if (networkLobbyPlayer == null || networkLobbyPlayer.gameObject == null)
         {
             if (LogFilter.logError)
             {
                 Debug.LogError("NetworkLobbyManager OnClientReadyToBegin no player at lobby slot " + NetworkLobbyManager.s_LobbyReadyToBeginMessage.slotId);
             }
         }
         else
         {
             networkLobbyPlayer.readyToBegin = NetworkLobbyManager.s_LobbyReadyToBeginMessage.readyState;
             networkLobbyPlayer.OnClientReady(NetworkLobbyManager.s_LobbyReadyToBeginMessage.readyState);
         }
     }
 }
All Usage Examples Of UnityEngine.Networking.NetworkLobbyPlayer::OnClientReady