public static bool LeaveRoom() { if (offlineMode) { offlineModeRoom = null; NetworkingPeer.SendMonoMessage(PhotonNetworkingMessage.OnLeftRoom, new object[0]); return(true); } if (room == null) { Debug.LogWarning("PhotonNetwork.room is null. You don't have to call LeaveRoom() when you're not in one. State: " + connectionStatesDetailed); } return(networkingPeer.OpLeave()); }
public static bool LeaveRoom(bool becomeInactive = true) { if (offlineMode) { offlineModeRoom = null; NetworkingPeer.SendMonoMessage(PhotonNetworkingMessage.OnLeftRoom); return(true); } if (room == null) { Debug.LogWarning("PhotonNetwork.room is null. You don't have to call LeaveRoom() when you're not in one. State: " + connectionStateDetailed); } else { becomeInactive = becomeInactive && room.playerTtl != 0; } return(networkingPeer.OpLeave(becomeInactive)); }
/// <summary> /// Leave the current game room /// </summary> public static void LeaveRoom() { if (room == null) { UnityEngine.Debug.LogError("PhotonNetwork: Error, you cannot leave a room if you're not in a room!"); return; } if (offlineMode) { offlineMode_inRoom = false; NetworkingPeer.SendMonoMessage(PhotonNetworkingMessage.OnLeftRoom); } else { networkingPeer.OpLeave(); } }