摄像机区域的架构改动

This commit is contained in:
2026-05-15 14:47:24 +08:00
parent 1b37297585
commit f264329751
3591 changed files with 1687228 additions and 446503 deletions

View File

@@ -0,0 +1,54 @@
using System.Collections;
using UnityEngine;
using TMPro;
namespace BaseGames.Tutorial
{
/// <summary>
/// 教程提示 UI 组件(架构 21_LiquidPuzzleModule §17
/// 负责显示/隐藏提示面板和文字duration ≤ 0 时不自动消隐。
/// </summary>
public class TutorialHintUI : MonoBehaviour
{
[SerializeField] private GameObject _panel;
[SerializeField] private TMP_Text _label;
#pragma warning disable CS0414
[SerializeField] private float _fadeSpeed = 4f;
#pragma warning restore CS0414
private Coroutine _autoHideCoroutine;
// ── 公共 API ──────────────────────────────────────────────────────
/// <summary>显示提示文字。duration ≤ 0 时不自动消隐。</summary>
public void Show(string text, float duration = 0f)
{
if (_panel != null) _panel.SetActive(true);
if (_label != null) _label.text = text;
if (_autoHideCoroutine != null)
StopCoroutine(_autoHideCoroutine);
if (duration > 0f)
_autoHideCoroutine = StartCoroutine(AutoHideRoutine(duration));
}
/// <summary>立即隐藏提示面板。</summary>
public void Hide()
{
if (_autoHideCoroutine != null)
{
StopCoroutine(_autoHideCoroutine);
_autoHideCoroutine = null;
}
if (_panel != null) _panel.SetActive(false);
}
// ── 内部 ──────────────────────────────────────────────────────────
private IEnumerator AutoHideRoutine(float duration)
{
yield return new WaitForSeconds(duration);
Hide();
_autoHideCoroutine = null;
}
}
}