using UnityEngine; using UnityEngine.SceneManagement; public class StartMenuController : MonoBehaviour { public void OnStartClick() { // Destroy the Start Menu UI so it doesn’t persist into the game scene GameObject menuUI = GameObject.FindWithTag("StartMenuUI"); if (menuUI != null) { Destroy(menuUI); } // Flag for BootRedirector so it doesn't loop back to menu BootRedirector.wasLaunchedFromMenu = true; // Load the game scene SceneManager.LoadScene("SampleScene"); } public void OnExitClick() { #if UNITY_EDITOR UnityEditor.EditorApplication.isPlaying = false; #else Application.Quit(); #endif } }