Game.Prefabs.FireAudioEffectData
Assembly: Assembly-CSharp
Namespace: Game.Prefabs
Type: struct
Base: System.ValueType, Unity.Entities.IComponentData, Unity.Entities.IQueryTypeParameter
Summary:
A small ECS component used to associate an entity with a fire audio effect entity. Typically attached to entities that need to reference or manage a separate audio-effect entity (e.g., a looping fire sound). Implementing IQueryTypeParameter allows this type to be used directly in queries or as a query parameter in Unity.Entities systems.
Fields
public Unity.Entities.Entity m_FireAudioEffectEntity
Holds the Entity reference for the audio-effect entity that plays the fire sound. This entity can be created/managed by an audio-spawning system and stored here so other systems can locate, control, or remove the audio effect associated with the owner entity.
Properties
- This struct does not declare any properties. It exposes a single public field for direct access.
Constructors
public FireAudioEffectData()
Structs have an implicit parameterless constructor. Typical construction initializes the field directly: Example:new FireAudioEffectData { m_FireAudioEffectEntity = Entity.Null }
Methods
- This type does not define any methods. It is a plain data carrier component intended for use with Unity.Entities systems and queries.
Usage Example
// Example: attach a fire audio effect entity to an existing entity
Entity fireEffectEntity = /* create or lookup the audio effect entity */;
Entity ownerEntity = /* the entity that owns the fire */;
var data = new FireAudioEffectData { m_FireAudioEffectEntity = fireEffectEntity };
entityManager.AddComponentData(ownerEntity, data);
// Example: reading in a system
Entities
.WithAll<FireAudioEffectData>()
.ForEach((Entity e, ref FireAudioEffectData fa) =>
{
// Access the audio entity: fa.m_FireAudioEffectEntity
// e.g., stop or destroy the audio entity when fire is extinguished
}).Schedule();