public void AssignAudio(ZonalAudio_SO registry, string name) { // assign mixer group _mixerGroup = registry.mixerGroup; // Find registry have the audio or not ZonalAudioInfo locatedAudioInfo = Array.Find(registry.minorAudios, minorAudio => minorAudio.name == name); if (locatedAudioInfo == null) { Debug.LogError($"Audio selected ({name}) is not available in the registry, please set audioInfo again..."); } else { audioInfo = locatedAudioInfo; AddAudioSource(); } }
// Constructor public ZonalAudioManager(ZonalAudio_SO registry, string name, GameObject __gameObject) { _gameObject = __gameObject; AssignAudio(registry, name); }