Example #1
0
 private void Awake()
 {
     _commonAudioSource        = gameObject.AddComponent <AudioSource>();
     _commonAudioSource.volume = SfxVolume;
     _musicAudioSource         = gameObject.AddComponent <AudioSource>();
     _musicAudioSource.volume  = MusicVolume;
     _database = Resources.Load <SfxDatabase>("Sfx/SfxDatabase");
 }
Example #2
0
File: Sfx.cs Project: atil/ld48
 private void Awake()
 {
     _commonAudioSource        = gameObject.AddComponent <AudioSource>();
     _commonAudioSource.volume = SfxVolume;
     _musicAudioSource         = gameObject.AddComponent <AudioSource>();
     _musicAudioSource.volume  = SfxVolume;
     _database = Resources.Load <SfxDatabase>("Sfx/SfxDatabase");
     if (Camera.main != null)
     {
         transform.SetParent(Camera.main.transform);
     }
 }