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

@@ -101,7 +101,7 @@ public class PlayerMovement : NetworkBehaviour
// Don't do movement unless this is the local player controlling it
// Otherwise we let the server handle moving us
//if (!IsLocalPlayer) { return; }
if (!IsLocalPlayer) { return; }
// Don't lock the cursor multiple times if this isn't the local player
// Also don't want to lock the cursor for the king
@@ -114,7 +114,7 @@ public class PlayerMovement : NetworkBehaviour
{
// Don't do movement unless this is the local player controlling it
// Otherwise we let the server handle moving us
//if (!IsLocalPlayer) { return; }
if (!IsLocalPlayer) { return; }
//Controls for camera

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

View File

@@ -6,8 +6,38 @@ EditorUserSettings:
serializedVersion: 4
m_ConfigSettings:
RecentlyUsedScenePath-0:
value: 22424703114646680e0b0227036c7b151b180b65082d2b3f6004083ff6e92434e3fe33fba92f31352d1b
flags: 0
RecentlyUsedScenePath-1:
value: 224247031146466f181a033019225303593b17282e3169032e2c1336f1af073be7e933d6cb353d3e204cfa320d2a18
flags: 0
RecentlyUsedScenePath-2:
value: 224247031146466f181a033019225303593b17282e3169032e2c1336f1af073be7e933d6ca3b36327717e1351027
flags: 0
RecentlyUsedScenePath-3:
value: 224247031146466f181a033019225303593b17282e3169032e2c1336f1af073be7e933d6ca3f31297717e1351027
flags: 0
RecentlyUsedScenePath-4:
value: 22424703114646680e0b0227036c7b151b180b6505263035233d1221fbd33134e7e422e0e8347129370bfb25
flags: 0
RecentlyUsedScenePath-5:
value: 224247031146467c0c03096f3d2c4a1e02161124623d28393930
flags: 0
RecentlyUsedScenePath-6:
value: 22424703114646680e0b0227036c78111b125507233d28242c20137df7ee3d2cfb
flags: 0
RecentlyUsedScenePath-7:
value: 22424703114646680e0b0227036c731f1415016439262f2434
flags: 0
RecentlyUsedScenePath-8:
value: 22424703114646680e0b0227036c6b19021b1d192f2d2835633c133af6f9
flags: 0
RecentlyUsedScenePath-9:
value: 22424703114646680e0b0227036c6f02131b172b282d347e38271427fb
flags: 0
UnityRemoteCompression:
value: 337f73
flags: 0
vcSharedLogLevel:
value: 0d5e400f0650
flags: 0