using TMPro; using UnityEngine; namespace LobbyScripts { public class SetRelayCode : MonoBehaviour { [SerializeField] private TextMeshProUGUI _codeTxt; private void OnEnable() { GameRelay.OnRelayCreated += SetCode; } private void OnDisable() { GameRelay.OnRelayCreated -= SetCode; } private void SetCode(string code) { if(!_codeTxt.gameObject.activeInHierarchy) _codeTxt.gameObject.SetActive(true); _codeTxt.SetText(code); } } }