public static void LeaveRoom()
{
if (!offlineMode && connectionStateDetailed != PeerState.Joined)
{
Debug.LogError("PhotonNetwork: Error, you cannot leave a room if you're not in a room!(1)");
return;
}
else if (room == null)
{
Debug.LogError("PhotonNetwork: Error, you cannot leave a room if you're not in a room!(2)");
return;
}
if (offlineMode)
{
offlineMode_inRoom = false;
NetworkingPeer.SendMonoMessage(PhotonNetworkingMessage.OnLeftRoom);
}
else
{
networkingPeer.OpLeave();
}
}