Guidance / API reference
AudioState
Namespace: AudioSystem
Inheritance: ScriptableObject
Properties
public string StateName { get; }
public string StateGroup { get; }
public StateVolumeMode VolumeMode { get; set; } // SetLevel (default, as before) or Offset
public IReadOnlyList<BusVolumeProperty> BusVolumes { get; }
public IReadOnlyList<SwitchProperty> SwitchValues { get; }
public IReadOnlyList<RTPCProperty> RtpcValues { get; }
public IReadOnlyList<EffectProperty> EffectProperties { get; }
public enum StateVolumeMode { SetLevel, Offset }
VolumeMode (3.1.0-dev.7; inspector: Bus Volume Mode). SetLevel: each bus is set to its volumeDb (AudioBus.SetVolume, the asset’s Volume), and leaving the state puts nothing back, as before. Offset: each bus moves by its volumeDb in AudioBus.StateOffsetDb, on top of its Volume and the player’s volume, never touching the asset; when another state in the group is set, or AudioManager.ClearState clears the group, the offsets go back over that transition time. Offset states in several groups add up on one bus.
Methods
Apply
public void Apply(float transitionTime)
Description: Applies this state’s properties (bus volumes, RTPCs, switches, effects). An Offset state’s bus volumes are left to AudioManager.SetState, which knows which states are active.
Nested Property Classes
[Serializable]
public class BusVolumeProperty
{
public AudioBus bus;
public float volumeDb;
}
[Serializable]
public class SwitchProperty
{
public string switchGroup;
public string switchValue;
}
[Serializable]
public class RTPCProperty
{
public string parameterName;
public float value;
}
[Serializable]
public class EffectProperty
{
public AudioBus bus;
public string propertyName;
public float value;
} From the Pepper.SFX 3.1 guides (API_REFERENCE.md). Something wrong or unclear? Tell me.