Ader Alisma 01 5d9f4d5a96 Ajout de Unity.TestMeshPro au GameAssembly
Permet d'utiliser TextMeshPro dans le code

Déplacé les script liés à la gestion de ressources dans le répertoire Script/Resource
2023-05-27 10:23:59 -04:00

34 lines
831 B
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using TMPro;
/// <summary>
/// Gère l'affichage des resources
/// </summary>
public class ResourceText : MonoBehaviour
{
[SerializeField]
private TextMeshProUGUI _rockText;
[SerializeField]
private TextMeshProUGUI _woodText;
[SerializeField]
private TextMeshProUGUI _foodText;
private ResourceManager _resourceManager;
// Start is called before the first frame update
void Start()
{
_resourceManager = ResourceManager.Instance;
}
// Update is called once per frame
void Update()
{
_rockText.text = _resourceManager.RockAmount.ToString();
_woodText.text = _resourceManager.WoodAmount.ToString();
_foodText.text = _resourceManager.FoodAmount.ToString();
}
}