Added info text

This commit is contained in:
2026-01-14 12:03:15 +00:00
parent c3a0e39c65
commit 0c43fc1112
5 changed files with 101 additions and 6 deletions

View File

@@ -4,17 +4,21 @@ namespace InterfaceOff
{
public class MovingWindow : WindowBase
{
private int m_Health = 5;
private int m_Health = int.MaxValue;
public override void OnWindowInstantiation()
{
Components.WindowImage.color = Color.blue;
/* Creates a random health value */
m_Health = Random.Range(2, 6);
Components.InfoText.text = $"{m_Health}";
}
public override void OnWindowClicked()
{
/* Decreases health and destroys if at 0 */
m_Health--;
Components.InfoText.text = $"{m_Health}";
if (m_Health <= 0)
{
Destroy(gameObject);