feat(): 大量更新
This commit is contained in:
@@ -25,6 +25,13 @@ namespace Core
|
||||
|
||||
private Dictionary<UILayer, Transform> layerRoots = new Dictionary<UILayer, Transform>();
|
||||
private Dictionary<string, UIBase> openedUIs = new Dictionary<string, UIBase>();
|
||||
|
||||
private IInputManager inputManager;
|
||||
|
||||
public void RegisterInputManager(IInputManager inputMgr)
|
||||
{
|
||||
inputManager = inputMgr;
|
||||
}
|
||||
|
||||
public void RegisterLayer(UILayer layer, Transform root)
|
||||
{
|
||||
@@ -122,18 +129,19 @@ namespace Core
|
||||
|
||||
private void UpdateCursorState()
|
||||
{
|
||||
if(inputManager == null) return;
|
||||
bool shouldLockCursor = !IsHasNonBackgroundUIActive; //&& !isInMainMenu; // 仅在没有非Background UI且不在主菜单时锁定鼠标
|
||||
if (shouldLockCursor)
|
||||
{
|
||||
InputManager.Instance.SetCursorState(false, CursorLockMode.Locked);
|
||||
inputManager.SetCursorState(false, CursorLockMode.Locked);
|
||||
}
|
||||
else
|
||||
{
|
||||
InputManager.Instance.SetCursorState(true, CursorLockMode.None);
|
||||
inputManager.SetCursorState(true, CursorLockMode.None);
|
||||
|
||||
}
|
||||
InputManager.Instance.SetInputForLook(shouldLockCursor);
|
||||
InputManager.Instance.SetInputForMove(shouldLockCursor);
|
||||
inputManager.SetInputForLook(shouldLockCursor);
|
||||
inputManager.SetInputForMove(shouldLockCursor);
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user