using UnityEngine; using UnityEngine.UIElements; using UnityEngine.SceneManagement; using System.IO; public class TitleScreenManager : MonoBehaviour { private UIDocument uiDocument; private Button newGameButton; private Button loadGameButton; private Button quitButton; private void Awake() { uiDocument = GetComponent(); if (uiDocument == null) { Debug.LogError("UIDocument component not found on TitleScreenManager GameObject."); return; } SetupUI(); } private void Start() { // Refresh the load game button state on start // This ensures it reflects the current save data status UpdateLoadGameButton(); } private void SetupUI() { var root = uiDocument.rootVisualElement; // Get button references newGameButton = root.Q