Stratasys-450mc-VR/Assets/Scripts/TextUIUpdate.cs

28 lines
593 B
C#
Raw Normal View History

2023-11-03 16:03:13 -04:00
using System.Collections;
using System.Collections.Generic;
using SO;
using SO.Channels;
using TMPro;
using UnityEngine;
public class TextUIUpdate : MonoBehaviour
{
[SerializeField] private TextMeshProUGUI text;
[SerializeField] private StepChangeChannelSO stepChangeChannel;
private void OnEnable()
{
stepChangeChannel.OnStepChanged += OnStepChanged;
}
private void OnDisable()
{
stepChangeChannel.OnStepChanged -= OnStepChanged;
}
private void OnStepChanged(StepSO step)
{
text.text = step.Description;
}
}