This commit is contained in:
2025-10-09 11:54:18 +08:00
parent 2aeeaf7659
commit 34f977047d
33 changed files with 181 additions and 152 deletions

View File

@@ -29,6 +29,7 @@ public class NetWorkThirdCharacterController : NetworkBehaviour
private Vector3 verticalVelocity;
private Vector2 moveInput;
private bool isGrounded;
[SerializeField]
private bool isCursorLocked = true;
void Awake()
@@ -45,6 +46,12 @@ public class NetWorkThirdCharacterController : NetworkBehaviour
RotateModel();
UpdateAnimator();
}
public void UpdateCursorState(bool value)
{
if (!isLocalPlayer) return;
isCursorLocked = value;
UpdateCursorState();
}
private void UpdateCursorState()
{
if (!isLocalPlayer) return;
@@ -119,8 +126,6 @@ public class NetWorkThirdCharacterController : NetworkBehaviour
if (!isLocalPlayer) return;
if (context.performed)
{
isCursorLocked = !isCursorLocked;
UpdateCursorState();
if (UIManager.Inst.CheckShow(nameof(SettingsWindow)))
{
UIManager.Inst.HideWindow(nameof(SettingsWindow));
@@ -195,6 +200,7 @@ public class NetWorkThirdCharacterController : NetworkBehaviour
public override void OnStartLocalPlayer()
{
Debug.Log("OnStartLocalPlayer");
GameSystem.Inst.localPlayer = this;
vCam.Priority = 15;
UpdateCursorState();
}

View File

@@ -48,6 +48,12 @@ public class ThirdCharacterController : MonoBehaviour
RotateModel();
UpdateAnimator();
}
public void UpdateCursorState(bool value)
{
if (!isLocalPlayer) return;
isCursorLocked = value;
UpdateCursorState();
}
private void UpdateCursorState()
{
if (!isLocalPlayer) return;
@@ -113,8 +119,6 @@ public class ThirdCharacterController : MonoBehaviour
if (!isLocalPlayer) return;
if (context.performed)
{
isCursorLocked = !isCursorLocked;
UpdateCursorState();
if (UIManager.Inst.CheckShow(nameof(SettingsWindow)))
{
UIManager.Inst.HideWindow(nameof(SettingsWindow));