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(); } }