Ajout de ResourceText. Permet de montrer l'inventaire des ressources dynamiquement. Modification de la gestion d'instance dans ResourceManager Changement des boutons pour la version TextMeshPro Debut de la coroutine de ResourceMaker
32 lines
768 B
C#
32 lines
768 B
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
using TMPro;
|
|
|
|
|
|
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();
|
|
}
|
|
}
|