mirror of
https://udrimavric.com/MAVRIC/Stratasys-450mc-VR.git
synced 2025-01-23 15:48:33 -05:00
35 lines
824 B
C#
35 lines
824 B
C#
|
using SO;
|
||
|
using SO.Channels;
|
||
|
using TMPro;
|
||
|
using UnityEngine;
|
||
|
|
||
|
public class StepDescription : MonoBehaviour
|
||
|
{
|
||
|
[SerializeField] private StepChangeChannelSO stepChangeChannel;
|
||
|
[SerializeField] private SimpleChannelSO stepDescriptionLoaded;
|
||
|
|
||
|
[SerializeField] private TMP_Text label;
|
||
|
|
||
|
private void OnEnable()
|
||
|
{
|
||
|
stepChangeChannel.OnStepChanged += OnStepChanged;
|
||
|
}
|
||
|
|
||
|
private void OnDisable()
|
||
|
{
|
||
|
stepChangeChannel.OnStepChanged -= OnStepChanged;
|
||
|
}
|
||
|
|
||
|
private void OnStepChanged(StepSO arg0)
|
||
|
{
|
||
|
if (label is null)
|
||
|
{
|
||
|
Debug.LogError($"{nameof(label)} is null...", this.gameObject);
|
||
|
return;
|
||
|
}
|
||
|
|
||
|
label.SetText(arg0.Description);
|
||
|
stepDescriptionLoaded.RaiseEvent();
|
||
|
}
|
||
|
}
|