Passion & UI

This commit is contained in:
SoulliesOfficial
2026-06-12 17:11:39 -04:00
parent 7bc1e1722c
commit 6d7ebc5825
3444 changed files with 865284 additions and 463132 deletions

View File

@@ -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()
{