public void RpcOnKicked(bool IsGameVersion) { if (isLocalPlayer == false) //only to the target faction ID { return; } //register the disconnection reason NetworkMgr.LastDisconnectionType = (IsGameVersion == true) ? NetworkManager_UNET.DisconnectionTypes.GameVersion : NetworkManager_UNET.DisconnectionTypes.Kicked; //make player leave lobby: NetworkMgr.LeaveLobby(); }
//allows the player to leave the current game: public void LeaveGame() { if (MultiplayerGame == false) { //load the main menu if it's a single player game: SceneManager.LoadScene(MainMenuScene); } else { if (InputManager.NetworkType == InputManager.NetworkTypes.UNET) { NetworkMgr_UNET.LastDisconnectionType = NetworkManager_UNET.DisconnectionTypes.Left; //if it's a MP game, then back to the network lobby: NetworkMgr_UNET.LeaveLobby(); } } }