You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
602 B
C#
29 lines
602 B
C#
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);
|
|
}
|
|
}
|
|
}
|