Дебажный менеджер музыки
This commit is contained in:
1 parent
0f8a629e4b
commit
b13cf8cfc0
96 files changed
+4042
-817
No files matched your search
@@ -0,0 +1,52 @@
|
||||
using System;
|
||||
using Code.Configs;
|
||||
using Cysharp.Threading.Tasks;
|
||||
using UnityEngine.AddressableAssets;
|
||||
using UnityEngine.Audio;
|
||||
using Object = UnityEngine.Object;
|
||||
|
||||
namespace Code.Audio
|
||||
{
|
||||
public class AudioFactory : IAudioFactory
|
||||
{
|
||||
private AssetReference _audioMixerPrefab;
|
||||
|
||||
private AssetReference[] _peacefulSoundtrack;
|
||||
private AssetReference[] _actionSoundtrack;
|
||||
private AssetReference[] _SFX;
|
||||
private AssetReference[] _enemies;
|
||||
private AssetReference[] _dispatcher;
|
||||
private AssetReference[] _character;
|
||||
|
||||
public AudioFactory(AudioMixerConfig audioMixerConfig,
|
||||
SoundtrackListConfig soundtrackListConfig,
|
||||
SFXListConfig sfxListConfig,
|
||||
EnemiesSoundListConfig enemiesSoundListConfig,
|
||||
DispatcherSoundListConfig dispatcherSoundListConfig,
|
||||
CharacterSoundListConfig characterSoundListConfig)
|
||||
{
|
||||
_audioMixerPrefab = audioMixerConfig.audioMixerPrefab;
|
||||
|
||||
_peacefulSoundtrack = soundtrackListConfig.peacefulSoundtrack;
|
||||
_actionSoundtrack = soundtrackListConfig.actionSoundtrack;
|
||||
_SFX = sfxListConfig.SFX;
|
||||
_enemies = enemiesSoundListConfig.enemies;
|
||||
_dispatcher = dispatcherSoundListConfig.dispatcher;
|
||||
_character = characterSoundListConfig.character;
|
||||
}
|
||||
public async UniTask<AudioMixer> CreateCanvas()
|
||||
{
|
||||
AudioMixer audioMixer = (await Addressables.InstantiateAsync(_audioMixerPrefab).ToUniTask()).GetComponent<AudioMixer>();
|
||||
|
||||
Object.DontDestroyOnLoad(audioMixer);
|
||||
|
||||
return audioMixer;
|
||||
}
|
||||
|
||||
public void ReleaseMixer()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user