using UnityEngine; using UnityEngine.SceneManagement; #if UNITY_EDITOR using UnityEditor; // This lets us access Editor-specific commands #endif public class MainMenu : MonoBehaviour { public void PlayGame() { Debug.Log("Play button clicked!"); // Reset coins here PlayerPrefs.SetInt("Coins", 0); PlayerPrefs.Save(); Debug.Log("Coins reset to 0"); SceneManager.LoadScene("Level 1"); } public void QuitGame() { Debug.Log("Quit button clicked!"); Application.Quit(); #if UNITY_EDITOR EditorApplication.isPlaying = false; // Stop Play Mode in Editor #endif } }