24 lines
579 B
C#
24 lines
579 B
C#
// GameIdDisplay.cs
|
|
using UnityEngine;
|
|
using TMPro;
|
|
|
|
public class GameIdDisplay : MonoBehaviour
|
|
{
|
|
[SerializeField] private TMP_Text _label;
|
|
|
|
void Start()
|
|
{
|
|
if (_label == null)
|
|
{
|
|
Debug.LogError("[GameIdDisplay] No TMP_Text assigned!");
|
|
return;
|
|
}
|
|
var id = GameSession.Instance?.GameId ?? string.Empty;
|
|
while (string.IsNullOrEmpty(id))
|
|
{
|
|
id = GameSession.Instance?.GameId;
|
|
Debug.Log("[GameIdDisplay] Waiting for GameId...");
|
|
}
|
|
_label.text = $"{id}";
|
|
}
|
|
} |