Passion & UI
This commit is contained in:
@@ -5,7 +5,7 @@ using Sirenix.OdinInspector;
|
||||
using SLSUtilities.General;
|
||||
using SLSUtilities.UI;
|
||||
using UnityEngine;
|
||||
using UnityEngine.InputSystem;
|
||||
using UnityEngine.Localization.Settings;
|
||||
using UnityEngine.SceneManagement;
|
||||
|
||||
namespace Cielonos.MainGame
|
||||
@@ -25,6 +25,7 @@ namespace Cielonos.MainGame
|
||||
{
|
||||
base.Awake();
|
||||
sceneSm = new SceneSubmodule(this);
|
||||
LocalizationSettings.SelectedLocale = LocalizationSettings.AvailableLocales.GetLocale("zh-CN");
|
||||
}
|
||||
|
||||
private void Start()
|
||||
@@ -55,32 +56,8 @@ namespace Cielonos.MainGame
|
||||
}
|
||||
}
|
||||
|
||||
private void Update()
|
||||
{
|
||||
if (Keyboard.current != null && Keyboard.current.escapeKey.wasPressedThisFrame)
|
||||
{
|
||||
// 优先:如果有 UI 页面打开,ESC 关闭栈顶页面
|
||||
if (UIPageManager.Instance != null && UIPageManager.Instance.HasOpenPages)
|
||||
{
|
||||
UIPageManager.Instance.CloseTopPage();
|
||||
return;
|
||||
}
|
||||
|
||||
#if !UNITY_EDITOR
|
||||
// 无页面打开时的 fallback:切换鼠标锁定状态(仅 Build)
|
||||
if (Cursor.lockState == CursorLockMode.Locked)
|
||||
{
|
||||
Cursor.lockState = CursorLockMode.None;
|
||||
Cursor.visible = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
Cursor.lockState = CursorLockMode.Locked;
|
||||
Cursor.visible = false;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
// ESC 统一由 PlayerInputSubcontroller.RegisterFunctionInputs() 处理,
|
||||
// 不再在此处重复监听,避免双重触发。
|
||||
|
||||
private void OnDestroy()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user