using System.Collections; using System.Collections.Generic; using UnityEngine; public class SettingPanelController : MonoBehaviour { [SerializeField] private GameObject settingPanel; [SerializeField] private GameObject gameStopPanel; [HideInInspector] public bool IsSettingOpen { get; private set; } [Header("¼³Á¤Ã¢ ¼±Åà ÆÐ³Î")] [SerializeField] private GameObject normalPanel; [SerializeField] private GameObject graphicPanel; [Header("¿­°í ´Ý´Â ¼Ò¸®")] [SerializeField] private AudioSource audioSource; [SerializeField] private AudioClip openSound; [SerializeField] private AudioClip closeSound; public void AllClose() { normalPanel.SetActive(false); graphicPanel.SetActive(false); } public void NormalOpen() { AllClose(); normalPanel.SetActive(true); if (audioSource != null && openSound != null) { audioSource.PlayOneShot(openSound); } } public void GraphicOpen() { AllClose(); graphicPanel.SetActive(true); if (audioSource != null && openSound != null) { audioSource.PlayOneShot(openSound); } } public void OpenSetting() { IsSettingOpen = true; if (audioSource != null && openSound != null) { audioSource.PlayOneShot(openSound); } settingPanel.SetActive(true); if (gameStopPanel != null) { gameStopPanel.SetActive(false); } } public void CloseSetting() { IsSettingOpen = false; if (audioSource != null && closeSound != null) { audioSource.PlayOneShot(closeSound); } settingPanel.SetActive(false); if (gameStopPanel != null) { gameStopPanel.SetActive(true); } } }