pgiz4_moi/Assets/Scripts/UIManager.cs

17 lines
518 B
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

using UnityEngine;
using UnityEngine.UI; // Обязательно для работы с UI
public class UIManager : MonoBehaviour
{
public Text coinText; // Сюда вы перетащите ваш текстовый объект
void Update()
{
if (coinText != null)
{
// Обновляем текст, отображая количество монет из PlayerController
coinText.text = "Монеты: " + PlayerController.coinCount;
}
}
}