using UnityEngine; using TMPro; public class UIManager : MonoBehaviour { public static UIManager Instance; // Singleton [Header("UI Elements (TextMeshProUGUI для цифр)")] public TextMeshProUGUI[] noteTexts; // Массив из 4 текстов (NoteText1, NoteText2, etc.) private void Awake() { if (Instance == null) Instance = this; else Destroy(gameObject); } public void DisplayNote(int index, char digit) { if (index >= 1 && index <= noteTexts.Length) { noteTexts[index - 1].text = digit.ToString(); // Отображаем цифру в соответствующем слоте noteTexts[index - 1].gameObject.SetActive(true); // Активируем, если был скрыт } else { Debug.LogError("Invalid note index: " + index); } } }