private void Setup(bool isHost) { NetworkConnection unet = NetworkConnection.Instance; FirebaseManager firebase = FirebaseManager.Instance; firebase.ExecuteOnInitialisation( () => { string networkAddress; if (isHost) { networkAddress = Network.player.ipAddress; firebase.SetValueAsync("connection/ip", networkAddress); firebase.SetValueAsync("connection/run", UnityEngine.Random.Range(0, 100)); } else { firebase.GetValueAsync("connection/ip", (value) => { networkAddress = ( string )value; unet.StartClient(networkAddress); } ); } } ); if (isHost) { unet.StartHost(); unet.OnClientHasConnected += (connectionId) => { Debug.Log("Client " + connectionId + " Connected!"); } ; } }