2026-04-29 게임 로딩 개선

This commit is contained in:
2026-04-29 18:42:59 +09:00
parent b626a1b5e6
commit dfb5857642
31 changed files with 1230 additions and 10 deletions

View File

@@ -6,8 +6,12 @@ public class SoundManager : MonoBehaviour
public static SoundManager Instance { get; private set; }
[SerializeField] private AudioSource _bgmSource;
[SerializeField] private AudioSource _sfxSource;
[SerializeField] private AudioMixer _mixer;
[Header("SFX")]
[SerializeField] private AudioClip SFX_UIHover;
private const string BGM_VOLUME_PARAM = "BGMVolume";
private const string SFX_VOLUME_PARAM = "SFXVolume";
@@ -26,6 +30,12 @@ private void OnDestroy()
if (Instance == this) Instance = null;
}
public void PlaySFX(AudioClip clip)
{
if(_sfxSource == null || clip == null) return;
_sfxSource.PlayOneShot(clip);
}
public void PlayBGM(AudioClip clip)
{
if (_bgmSource == null || clip == null) return;
@@ -75,4 +85,9 @@ private void SetMixerVolume(string parameter, float linear)
float db = linear > 0.0001f ? Mathf.Log10(linear) * 20f : -80f;
_mixer.SetFloat(parameter, db);
}
public void SFXPlay_UIHover()
{
PlaySFX(SFX_UIHover);
}
}