private void Awake() { _commonAudioSource = gameObject.AddComponent <AudioSource>(); _commonAudioSource.volume = SfxVolume; _musicAudioSource = gameObject.AddComponent <AudioSource>(); _musicAudioSource.volume = MusicVolume; _database = Resources.Load <SfxDatabase>("Sfx/SfxDatabase"); }
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); } }