diff --git a/Assets/Script/Common/AudioManager.cs b/Assets/Script/Common/AudioManager.cs index 9e8c51c..017cccf 100644 --- a/Assets/Script/Common/AudioManager.cs +++ b/Assets/Script/Common/AudioManager.cs @@ -102,7 +102,7 @@ public class AudioManager : Singleton public void PlayClickSound() { - if (sfxAudioSource != null) + if (isPlaySFX && sfxAudioSource != null) { sfxAudioSource.PlayOneShot(clickSound, sfxVolume); } @@ -111,7 +111,7 @@ public class AudioManager : Singleton // 닫기 사운드(SFX) 재생 public void PlayCloseSound() { - if (sfxAudioSource != null) + if (isPlaySFX && sfxAudioSource != null) { sfxAudioSource.PlayOneShot(closeSound, sfxVolume); } diff --git a/Assets/Script/Utilty/SingleInteractableButtonHandler.cs b/Assets/Script/Utilty/SingleInteractableButtonHandler.cs new file mode 100644 index 0000000..fe272c8 --- /dev/null +++ b/Assets/Script/Utilty/SingleInteractableButtonHandler.cs @@ -0,0 +1,52 @@ +using UnityEngine; +using UnityEngine.UI; + +public class SingleInteractableButtonHandler : MonoBehaviour +{ + [Tooltip("이 버튼이 한 번만 클릭되도록 제한할지 여부")] + [SerializeField] private bool enableOneTimeClick = true; + + private Button _button; + + private bool hasBeenClicked = false; + + private void Awake() + { + // 버튼 컴포넌트 가져오기 + _button = GetComponent