mirror of
https://projects.caleb-brown.dev/UDRI-XRT/UDRIGEEKCup2024.git
synced 2025-01-22 15:18:25 -05:00
32 lines
647 B
C#
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();
|
|
}
|
|
}
|
|
}
|