多轮审查评估

This commit is contained in:
2026-05-13 09:19:54 +08:00
parent 458f344e83
commit 1b37297585
57 changed files with 3019 additions and 218 deletions

View File

@@ -3,12 +3,12 @@ using UnityEngine;
using UnityEngine.UI;
using TMPro;
using BaseGames.Core.Events;
using BaseGames.Localization;
namespace BaseGames.UI
{
/// <summary>
/// 全屏加载界面:进度条 + 提示文字 + 随机背景图(架构 10_UIModule §7.7)。
/// 注:提示文字直接使用字符串 keyP4-5 本地化模块完成后替换为 LocalizationManager.Get
/// </summary>
public class LoadingScreenManager : MonoBehaviour
{
@@ -16,7 +16,7 @@ namespace BaseGames.UI
[SerializeField] private Image _progressFill;
[SerializeField] private TMP_Text _tipText;
[SerializeField] private Image[] _backgroundArts;
[SerializeField] private string[] _tipMessages; // 直接文字(非本地化 key
[SerializeField] private string[] _tipMessages; // 本地化 key(对应 "UI" 表中的条目,如 "tip_explore"
[SerializeField] private float _minDisplayTime = 0.5f;
[Header("Event Channels")]
@@ -25,18 +25,17 @@ namespace BaseGames.UI
[SerializeField] private FloatEventChannelSO _onLoadingProgressUpdated;
private float _shownAt;
private readonly CompositeDisposable _subs = new();
private void OnEnable()
{
if (_onLoadingStarted != null) _onLoadingStarted.OnEventRaised += Show;
if (_onLoadingComplete != null) _onLoadingComplete.OnEventRaised += Hide;
if (_onLoadingProgressUpdated != null) _onLoadingProgressUpdated.OnEventRaised += SetProgress;
_onLoadingStarted?.Subscribe(Show).AddTo(_subs);
_onLoadingComplete?.Subscribe(Hide).AddTo(_subs);
_onLoadingProgressUpdated?.Subscribe(SetProgress).AddTo(_subs);
}
private void OnDisable()
{
if (_onLoadingStarted != null) _onLoadingStarted.OnEventRaised -= Show;
if (_onLoadingComplete != null) _onLoadingComplete.OnEventRaised -= Hide;
if (_onLoadingProgressUpdated != null) _onLoadingProgressUpdated.OnEventRaised -= SetProgress;
_subs.Clear();
}
// ── 公开 APISceneLoader 可直接调用)────────────────────────────────
@@ -54,9 +53,9 @@ namespace BaseGames.UI
_backgroundArts[Random.Range(0, _backgroundArts.Length)].enabled = true;
}
// 随机提示
// 随机提示(通过 LocalizationManager 解析 key
if (_tipText != null && _tipMessages != null && _tipMessages.Length > 0)
_tipText.text = _tipMessages[Random.Range(0, _tipMessages.Length)];
_tipText.text = LocalizationManager.Get(_tipMessages[Random.Range(0, _tipMessages.Length)], "UI");
}
public void Hide() => StartCoroutine(HideAfterMinTime());