Unlock Cursor after transitioning from the game scene

This commit is contained in:
2021-11-05 14:05:33 -05:00
parent 2fe2fa5764
commit d23c4ce412
4 changed files with 38 additions and 2 deletions

View File

@@ -23,6 +23,9 @@ public class LobbyUI : NetworkBehaviour {
public override void NetworkStart()
{
// Unlock the player cursor if they get sent back here after a match
Cursor.lockState = CursorLockMode.None;
if (IsClient)
{
lobbyPlayers.OnListChanged += HandleLobbyPlayersStateChanged;

View File

@@ -24,6 +24,9 @@ public class ConnectButtons : MonoBehaviour {
ErrorPanel.SetActive(false);
PlayerPrefs.GetString("PlayerName");
// Unlock the player cursor if they got sent back to the title screen from in game
Cursor.lockState = CursorLockMode.None;
}
// Connect to the dedicated server