diff --git a/Assets/Script/Gameplay/Player/PlayerWatchModeController.cs b/Assets/Script/Gameplay/Player/PlayerWatchModeController.cs index 45abbfc..39bde59 100644 --- a/Assets/Script/Gameplay/Player/PlayerWatchModeController.cs +++ b/Assets/Script/Gameplay/Player/PlayerWatchModeController.cs @@ -57,12 +57,21 @@ namespace Gameplay.Player { case WatchMode.Normal: SetSeeLines(false); + inputManager.SetCursorState(false, CursorLockMode.Locked); + inputManager.SetInputForLook(true); + inputManager.SetInputForMove(true); break; case WatchMode.Inside: SetSeeLines(false); + inputManager.SetCursorState(true, CursorLockMode.Confined); + inputManager.SetInputForLook(false); + inputManager.SetInputForMove(false); break; case WatchMode.Outside: SetSeeLines(true); + inputManager.SetCursorState(false, CursorLockMode.Locked); + inputManager.SetInputForLook(true); + inputManager.SetInputForMove(true); break; default: throw new ArgumentOutOfRangeException(); diff --git a/Assets/Script/Gameplay/UI/PlayerEditViewer.cs b/Assets/Script/Gameplay/UI/PlayerEditViewer.cs index 150cfd3..90accbc 100644 --- a/Assets/Script/Gameplay/UI/PlayerEditViewer.cs +++ b/Assets/Script/Gameplay/UI/PlayerEditViewer.cs @@ -33,7 +33,6 @@ namespace UI private void Start() { - inputManager = InputManager.Instance; } public void OnEnterInsideWatchMode() @@ -47,16 +46,11 @@ namespace UI } else { - //TODO: 这里可能需要显示“无可编辑对象”之类的提示 if (noEditableTargetPanel != null) { noEditableTargetPanel.SetActive(true); } } - - inputManager.SetCursorState(true, CursorLockMode.Confined); - inputManager.SetInputForLook(false); - inputManager.SetInputForMove(false); } public void OnExitInsideWatchMode() @@ -69,9 +63,6 @@ namespace UI noEditableTargetPanel.SetActive(false); } - inputManager.SetCursorState(true, CursorLockMode.Locked); - inputManager.SetInputForLook(true); - inputManager.SetInputForMove(true); } // 获取 PlayerEditController 的回调 @@ -128,7 +119,7 @@ namespace UI componentViewers.Clear(); } - // TODO: 根据 components 生成 UI, 根据拥有的 IEditComponent 的数量动态生成 UI 元素。布局为环绕着面板中心排列(自适应间隔)。 + // 根据 components 生成 UI, 根据拥有的 IEditComponent 的数量动态生成 UI 元素。布局为环绕着面板中心排列(自适应间隔)。 private void GenerateComponentUI() { if (components == null || components.Count == 0 || componentEditViewerPrefab == null) return;