using Assets.Scripts.Enums; using System.Collections; using System.Collections.Generic; using UnityEditor; using UnityEngine; using UnityEngine.SceneManagement; public class MainMenuManager : SettingsManager { [SerializeField] public SceneAsset startGameScene; public LevelChanger levelChanger; private void Start() { SoundManager.instance.ChangeMusic(SoundName.MusicMainMenu); } public void StartGame() { SaveSystem.isGameLoaded = false; levelChanger.FadeToScene(startGameScene.name); } public void LoadGame() { SaveSystem.isGameLoaded = true; levelChanger.FadeToScene(startGameScene.name); } public void EndGame() { #if (UNITY_EDITOR || DEVELOPMENT_BUILD) Debug.Log(this.name + ": " + this.GetType() + ": " + System.Reflection.MethodBase.GetCurrentMethod().Name); #endif #if (UNITY_EDITOR) UnityEditor.EditorApplication.isPlaying = false; #elif (UNITY_STANDALONE) Application.Quit(); #elif (UNITY_WEBGL) // NOT WORKING // Need to add new scene "QuitScene" // change camera to solid color "black" // add scene to build settings // SceneManager.LoadScene("QuitScene"); #else Application.Quit(); #endif } }