Global Game Jam 2021
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

50 lines
847 B

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);
}
}