I have some experience with Mixer Groups give me like 5-10 minutes I’ll have a script together for you that shows how you can get what you are looking for.
Here’s a sample script that will do what you are looking for. I had a similar problem to solve when I was working on my object pooling asset; it’s available from the asset store link in my signature(shameless plug).
using UnityEngine;
using UnityEngine.Audio;
public class AudioExtension : MonoBehaviour {
public AudioMixer audioMixer;
public AudioMixerGroup[] AllMixerGroups {
get{
return audioMixer.FindMatchingGroups(string.Empty);
;}
}
}
Essentially what you want to do is create a public variable for the audio mixer you want to get groups from. Drag your AudioMixer onto that variable in the inspector and use the extension method to return all the mixer groups associated with that mixer. Simple as that! Good luck and I hope this helps you out!
Also, if you are looking for a specific mixer group you can just replace the string.Empty with the string that represents the path to your mixer group. eg “Sound”
No worries. If you have any more questions you can get at me on Twitter or via my website. Links are in my signature. Best of luck in all your endeavours!