30 lines
755 B
C#
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);
|
|
}
|
|
}
|