first commit

This commit is contained in:
2026-06-04 15:45:39 +03:00
commit e12fcea2e8
73 changed files with 9576 additions and 0 deletions
+59
View File
@@ -0,0 +1,59 @@
using System.Collections;
using UnityEngine;
using UnityEngine.UI;
public class HintManager : MonoBehaviour
{
public static HintManager Instance { get; private set; }
public GameObject hintPanel;
public Text hintText;
private Coroutine hideRoutine;
private void Awake()
{
if (Instance != null && Instance != this)
{
Destroy(gameObject);
return;
}
Instance = this;
HideHint();
}
public void ShowHint(string text, float duration)
{
if (hintPanel == null || hintText == null)
{
return;
}
// Restarting the timer lets stronger narrative hints replace short interaction prompts.
hintText.text = text;
hintPanel.SetActive(true);
if (hideRoutine != null)
{
StopCoroutine(hideRoutine);
}
hideRoutine = StartCoroutine(HideAfterDelay(duration));
}
public void HideHint()
{
if (hintPanel != null)
{
hintPanel.SetActive(false);
}
}
private IEnumerator HideAfterDelay(float delay)
{
yield return new WaitForSeconds(delay);
HideHint();
hideRoutine = null;
}
}