audioMixer
Gain access to the AudioMixer that this AudioMixerGroup belongs to (Read Only).
Read time 1 minuteLast updated 13 days ago
Definition
- Type: Property
- Namespace: UnityEngine.Audio
- Assembly: UnityEngine.AudioModule
public AudioMixer audioMixer { get; }
Remarks
This property is useful if you want to access the AudioMixer and modify its properties or the properties of its groups dynamically.
Examples
using UnityEngine;using UnityEngine.Audio;public class ExampleAudioMixer : MonoBehaviour{ public AudioMixerGroup audioMixerGroup; void Start() { // Output the name of the AudioMixer that this AudioMixerGroup belongs to AudioMixer parentMixer = audioMixerGroup.audioMixer; Debug.Log("AudioMixer Name: " + parentMixer.name); // Use the exposed parameters of different AudioMixerGroups to change the volume of those groups. // Make sure to expose the parameters you want to change in your groups and rename them to something memorable. // "TestVolume" and "MainVolume" are the exposed and renamed volume parameters of 2 different AudioMixerGroups. parentMixer.SetFloat("TestVolume", -80f); parentMixer.SetFloat("MainVolume", 5.0f); }}