using UnityEngine; using UnityEngine.UIElements; /// /// singleton for a single source of truth game state and flow management /// public class SideViewUI : MonoBehaviour { /// /// button to change to transition to the account view /// private Button _accountButton; /// /// text that displays the users stable chroma accuracy /// private Label _chromaAccuracyText; /// /// text that displays the connection status to the backend /// private Label _connectionStatusText; /// /// text that displays the users stable hue accuracy /// private Label _hueAccuracyText; /// /// button to transition to the leaderboard view /// private Button _leaderboardButton; /// /// text that displays the users stable lightness accuracy /// private Label _lightnessAccuracyText; /// /// button to transition to the game view /// private Button _playButton; /// /// text that displays the username /// private Label _playerNameText; /// /// text that displays the users' rating /// private Label _playerRatingText; private void Start() { GameManager.Instance.RegisterOnLocalPlayerDataUpdate(RenderFromPlayerData); } /// /// function to subscribe button events to their respective functions /// private void OnEnable() { var ui = GetComponent().rootVisualElement; _playButton = ui.Q