using System.Collections; using System.Collections.Generic; using UnityEngine; using NaughtyAttributes; public class MainMenuUI : MonoBehaviour { [SerializeField,Scene] private string m_JoinScene; [SerializeField] private GameObject[] m_Panels; private void OnEnable() { OnClickChangePanel(m_Panels[0]); } public void OnClickPlay() { UnityEngine.SceneManagement.SceneManager.LoadScene(m_JoinScene); } public void OnClickQuit() { #if UNITY_EDITOR UnityEditor.EditorApplication.isPlaying = false; #else Application.Quit(); #endif } public void OnClickChangePanel(GameObject newPanel) { foreach (var panel in m_Panels) panel.SetActive(false); if (newPanel != null) newPanel.SetActive(true); } }