refactor(WatchMode): 将鼠标逻辑修改移动到PlayerWatchModeController当中
This commit is contained in:
@@ -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();
|
||||
|
@@ -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;
|
||||
|
Reference in New Issue
Block a user