Skip to content

Game.Prefabs.CullingAudioSettingsData

Assembly: Assembly-CSharp
Namespace: Game.Prefabs

Type: struct

Base: IComponentData, IQueryTypeParameter

Summary:
Component data used by the game's ECS to control audio culling parameters for different sound categories. Each field configures a maximum simultaneous count (amount) and a culling distance for a given audio category. Intended to reduce CPU/voice usage by limiting how many and how far audio sources of a certain type are active.


Fields

  • public int m_FireCullMaxAmount
    Maximum number of simultaneous "fire" audio sources allowed before additional sources are culled. Typical unit: count of sources.

  • public float m_FireCullMaxDistance
    Maximum distance (in Unity units/meters) at which "fire" audio sources are considered for playing. Sources beyond this distance are culled.

  • public int m_CarEngineCullMaxAmount
    Maximum number of simultaneous car engine audio sources allowed before additional car engine sounds are culled.

  • public float m_CarEngineCullMaxDistance
    Maximum distance (in Unity units/meters) at which car engine audio sources are considered for playing. Sources farther away are culled.

  • public int m_PublicTransCullMaxAmount
    Maximum number of simultaneous public transport (buses/trains/trams) audio sources allowed before additional ones are culled.

  • public float m_PublicTransCullMaxDistance
    Maximum distance (in Unity units/meters) at which public transport audio sources are considered for playing. Sources beyond this threshold are culled.

Properties

  • None. This struct only exposes public fields.

Constructors

  • public CullingAudioSettingsData()
    Implicit default constructor supplied by the struct. All numeric fields default to 0 (ints = 0, floats = 0.0f). Initialize explicitly when creating an instance to set desired culling behavior.

Methods

  • None. This type is a plain data component (IComponentData) and does not define behavior.

Usage Example

// Example: create and assign culling audio settings to an entity
var settings = new CullingAudioSettingsData
{
    m_FireCullMaxAmount = 8,
    m_FireCullMaxDistance = 40f,
    m_CarEngineCullMaxAmount = 25,
    m_CarEngineCullMaxDistance = 120f,
    m_PublicTransCullMaxAmount = 12,
    m_PublicTransCullMaxDistance = 90f
};

var entityManager = World.DefaultGameObjectInjectionWorld.EntityManager;
var e = entityManager.CreateEntity();
entityManager.AddComponentData(e, settings);

Notes: - Amount fields limit how many simultaneous audio instances of a category can play; distance fields limit playback by spatial proximity. Values should be tuned according to performance targets and perceived audio density. - Because this is an IComponentData, systems can read these values from matching entities and apply culling logic in audio management systems.