1
0
mirror of https://projects.caleb-brown.dev/UDRI-XRT/UDRIGEEKCup2024.git synced 2025-01-22 15:18:25 -05:00
UDRIGEEKCup2024/Assets/GolfControls/UI/StrokeDisplay.cs
2024-04-24 14:52:55 -04:00

32 lines
647 B
C#

using System;
using TMPro;
using Unity.VisualScripting;
using UnityAtoms.BaseAtoms;
using UnityEngine;
namespace GolfControls
{
public class StrokeDisplay : MonoBehaviour
{
public TextMeshProUGUI numText;
public IntVariable strokeVariable;
private void OnEnable()
{
strokeVariable.Changed.Register(UpdateText);
}
private void OnDisable()
{
strokeVariable.Changed.Unregister(UpdateText);
}
private void UpdateText(int value)
{
numText.color = Color.white;
numText.text = value.ToString();
}
}
}