Files
TutorialRTS/Assets/Scripts/ResourceSourceUI.cs

33 lines
741 B
C#
Raw Permalink Normal View History

2026-03-19 17:31:51 +00:00
using UnityEngine;
using TMPro;
public class ResourceSourceUI : MonoBehaviour
{
public GameObject popupPanel;
public TextMeshProUGUI resourceQuantityText;
public ResourceSource resource;
// Start is called once before the first execution of Update after the MonoBehaviour is created
void Start()
{
2026-03-20 17:34:22 +00:00
resourceQuantityText.text = resource.quantity.ToString();
2026-03-19 17:31:51 +00:00
}
// Update is called once per frame
void Update()
{
}
void OnMouseEnter()
{
popupPanel.SetActive(true);
}
void OnMouseExit()
{
popupPanel.SetActive(false);
}
public void OnResourceQuantityChange()
{
resourceQuantityText.text = resource.quantity.ToString();
}
}