public void HostGame(Action <ResponseType> response) { // Set this player as the host Host = Game.Name; Hosting = true; DisconnectedWithError = false; // Initialize avatar manager and set the host's avatar avatars = new AvatarsManager(); avatars.AddPlayer(Host); Game.Manager.AddHost(avatars[Host]); net.StartAsHost(Game.Name, (ResponseType res) => { if (res == ResponseType.Success) { net.clientsUpdated = OnUpdateClients; net.onDisconnected = OnDisconnect; net.onUpdateDroppedClients = OnUpdateDropped; } else { OnDisconnect(); } response(res); }); }