Game.Prefabs.AudioGroupSettings
Assembly: Assembly-CSharp
Namespace: Game.Prefabs
Type: class
Base: System.Object
Summary:
Holds configuration for an audio "group" (for example traffic-related ambient sounds) used by the game's audio/ambience system. The settings control which EffectPrefabs are used for near/far variants, how quickly the group's sound responds to changes, how the group's intensity scales with simulated activity, and how camera height affects rolloff between near and far sounds.
Fields
-
public GroupAmbienceType m_Type
Type/category of the ambience group (enum). Identifies which group this settings instance applies to (e.g., traffic, crowd, etc.). -
public float m_FadeSpeed
Tooltip: "The higher the value, the faster the traffic group sound reacts to changes in the traffic; balance between delay and jumpiness"
Range: 0.0 — 1.0. Default: 0.05f. Controls the responsiveness of the group's perceived intensity (smoothing / interpolation speed). -
public float m_Scale
Tooltip: "The higher this value, the less traffic is needed for the group sound effect to be heard"
A multiplicative factor that scales required simulated activity for the audio group to be audible (higher = easier to hear). -
public float2 m_Height
Controls min and max camera heights used for linear rolloff when computing the "far" sound contribution. (float2 comes from Unity.Mathematics and represents [minHeight, maxHeight].) -
public EffectPrefab m_GroupSoundNear
Reference to the EffectPrefab used for the near variant of this group's sound (played when camera is closer / near sources). -
public EffectPrefab m_GroupSoundFar
Reference to the EffectPrefab used for the far variant of this group's sound (played when camera is farther / using camera-height rolloff). -
public float2 m_NearHeight
Controls min and max camera heights used for linear rolloff when computing the "near" sound contribution. -
public float m_NearWeight
Tooltip: "Larger values mean the near sound is only heard more near the sources, 1 = same as far"
Default: 2.0f. Weighting factor that influences how strongly the near sound is attenuated with distance/height relative to the far sound.
Properties
- None. All configuration values are exposed as public fields in this class.
Constructors
public AudioGroupSettings()
Default constructor. Most fields are initialized inline (for example m_FadeSpeed = 0.05f, m_NearWeight = 2f); other fields remain at their type defaults until set by data (e.g., from prefab data or mod code).
Methods
- None defined on this type. This class is a plain data container and relies on external systems to read these values and apply them to audio/ambience logic.
Usage Example
// Example: create and configure an audio group settings instance for a custom mod.
var settings = new AudioGroupSettings
{
m_Type = GroupAmbienceType.Traffic,
m_FadeSpeed = 0.08f,
m_Scale = 1.2f,
m_Height = new float2(20f, 200f),
m_NearHeight = new float2(0f, 60f),
m_NearWeight = 1.8f,
m_GroupSoundNear = /* assign EffectPrefab reference for near sound */,
m_GroupSoundFar = /* assign EffectPrefab reference for far sound */
};
// The audio manager / ambience system would read these fields to:
// - choose which EffectPrefab to instantiate/play (near vs far),
// - interpolate perceived intensity using m_FadeSpeed,
// - scale required simulation activity with m_Scale,
// - compute camera-height based rolloff using m_Height and m_NearHeight and m_NearWeight.