public override void OnStartClient() { if (instance) { Debug.LogError("ERROR: Another GameSession!"); } instance = this; networkListener = FindObjectOfType <BP_Listener>(); networkListener.gameSession = this; _networkTransmitter = GetComponent <BeerPongNetworkTransmitter>(); if (gameState != BP_GameState.Lobby) { gameState = BP_GameState.Lobby; } }
//Client RPCs public void RpcOnStartedGame() { _networkTransmitter = GetComponent <BeerPongNetworkTransmitter>(); _networkTransmitter.BeerPongOnDataCompletelyReceived += OnDataCompleteReceived; _networkTransmitter.BeerPongOnDataFragmentReceived += OnDataFragmentReceived; }