Projext/Assets/7.Other Code/System_Scripts/SettingPanelController.cs
2026-01-30 18:27:44 +09:00

30 lines
755 B
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class SettingPanelController : MonoBehaviour
{
[SerializeField] private GameObject settingPanel;
[SerializeField] private AudioSource audioSource;
[SerializeField] private AudioClip openSound;
[SerializeField] private AudioClip closeSound;
public void OpenSetting()
{
if (audioSource != null && openSound != null)
{
audioSource.PlayOneShot(openSound);
}
settingPanel.SetActive(true);
}
public void CloseSetting()
{
if (audioSource != null && closeSound != null)
{
audioSource.PlayOneShot(closeSound);
}
settingPanel.SetActive(false);
}
}