Skip to content

Commit

Permalink
Update AudioManager.cs
Browse files Browse the repository at this point in the history
  • Loading branch information
VirtueSky committed Jan 19, 2024
1 parent f9ed74a commit 4847056
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions VirtueSky/Audio/Runtime/AudioManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ namespace VirtueSky.Audio
{
public class AudioManager : BaseMono
{
[SerializeField] private bool isDontDestroyOnLoad;
[Space] [SerializeField] private Pools pool;
[SerializeField] private SoundComponent soundComponentPrefab;

Expand Down Expand Up @@ -39,8 +40,11 @@ [Space] [Header("AudioManager Settings")] [SerializeField]

private void Awake()
{
DontDestroyOnLoad(this.gameObject);
pool.Initialize();
if (isDontDestroyOnLoad)
{
DontDestroyOnLoad(this.gameObject);
}

sfxVolume.AddListener(OnSfxVolumeChanged);
musicVolume.AddListener(OnMusicVolumeChanged);
}
Expand Down

0 comments on commit 4847056

Please sign in to comment.