Tetra/Minesweeper/Assets/Scripts/GameIdDisplay.cs
2025-05-01 01:48:08 -07:00

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}";
}
}