Onto lesson 2
This commit is contained in:
32
Assets/Scripts/ResourceSourceUI.cs
Normal file
32
Assets/Scripts/ResourceSourceUI.cs
Normal file
@@ -0,0 +1,32 @@
|
||||
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()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
// 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();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user