35 lines
867 B
C#
35 lines
867 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;
|
|
[SerializeField]
|
|
private TextMeshProUGUI _berryText;
|
|
|
|
private ResourceManager _resourceManager;
|
|
|
|
void Start()
|
|
{
|
|
_resourceManager = ResourceManager.Instance;
|
|
}
|
|
|
|
void Update()
|
|
{
|
|
_rockText.text = _resourceManager.RockAmount.ToString();
|
|
_woodText.text = _resourceManager.WoodAmount.ToString();
|
|
_foodText.text = _resourceManager.FoodAmount.ToString();
|
|
_berryText.text = _resourceManager.BerryAmount.ToString();
|
|
}
|
|
}
|