Table of Contents

Interface IAudioSystem

Namespace
Framework.Systems.Audio
Assembly
Assembly-CSharp.dll

BGM/SFX 재생, 정지, 볼륨 제어 계약.

public interface IAudioSystem

Examples

_audioSystem.PlayBGM(AddressableKeys.BgmMain);
var handle = _audioSystem.PlaySFX(AddressableKeys.SfxShoot);
_audioSystem.SetVolume(AudioChannel.SFX, 0.8f);
_audioSystem.StopBGM(fadeTime: 1f);

Remarks

에셋 키는 AddressableKeys 상수 사용. 매직 스트링 금지. AudioChannel별 볼륨은 독립적으로 관리된다.

Methods

PlayBGM(string)

BGM 재생. 이미 재생 중이면 교체.

void PlayBGM(string key)

Parameters

key string

Addressable 오디오 클립 키.

PlaySFX(string)

SFX 재생. 동시 재생 가능.

AudioHandle PlaySFX(string key)

Parameters

key string

Addressable 오디오 클립 키.

Returns

AudioHandle

재생 제어용 핸들. Stop/Pause에 사용.

SetVolume(AudioChannel, float)

채널별 볼륨 설정.

void SetVolume(AudioChannel channel, float volume)

Parameters

channel AudioChannel

제어할 채널 (BGM/SFX/UI).

volume float

볼륨 값 (0f ~ 1f).

StopBGM(float)

현재 BGM 정지.

void StopBGM(float fadeTime = 0)

Parameters

fadeTime float

페이드 아웃 시간(초). 0이면 즉시 정지.