36 lines
740 B
C#
36 lines
740 B
C#
using UnityEngine;
|
|
using UnityEngine.SceneManagement;
|
|
|
|
public class StartMenuManager : MonoBehaviour
|
|
{
|
|
[SerializeField]
|
|
private GameObject _menuPanelUI;
|
|
[SerializeField]
|
|
private GameObject _settingPanelUI;
|
|
|
|
private void Awake()
|
|
{
|
|
_menuPanelUI.SetActive(true);
|
|
_settingPanelUI.SetActive(false);
|
|
}
|
|
|
|
public async void LoadScene(int index)
|
|
{
|
|
await SceneManager.LoadSceneAsync(index);
|
|
}
|
|
|
|
public void SetSettingPanelActive(bool value)
|
|
{
|
|
_settingPanelUI.SetActive(value);
|
|
_menuPanelUI.SetActive(!value);
|
|
}
|
|
|
|
public void Quit()
|
|
{
|
|
#if UNITY_EDITOR
|
|
UnityEditor.EditorApplication.ExitPlaymode();
|
|
#else
|
|
Application.Quit();
|
|
#endif
|
|
}
|
|
} |