Game.Prefabs.RadioEventData
Assembly: Assembly-CSharp (typical Unity game/mod assembly)
Namespace: Game.Prefabs
Type: struct
Base: System.ValueType, Unity.Entities.IComponentData, Unity.Entities.IQueryTypeParameter
Summary:
RadioEventData is a plain data (ECS) component used by the game's radio system. It packages a target EntityArchetype together with a radio segment type and an optional emergency delay (in frames). As an IComponentData it can be attached to entities and used in DOTS systems; implementing IQueryTypeParameter indicates it is intended to be used as a type in entity queries or related APIs. This struct contains no behavior — it only stores values that systems can read to spawn or schedule radio segments.
Fields
-
public EntityArchetype m_Archetype
Stores an EntityArchetype describing the entity layout to be created/used for this radio event. Systems that spawn or configure radio segment entities can use this archetype to create entities with the correct components. -
public Radio.SegmentType m_SegmentType
Indicates which radio segment variant to play/instantiate. Radio.SegmentType is an enum (in Game.Audio.Radio) representing available segment categories or identifiers used by the audio/radio subsystem. -
public int m_EmergencyFrameDelay
A frame count delay used for "emergency" scheduling behavior. When non-zero, systems may wait this many frames before treating this event as an emergency or before triggering emergency-specific behavior. Interpretation depends on the consuming system.
Properties
- (none)
This struct declares no C# properties; it exposes three public fields only.
Constructors
- (default struct constructor)
No explicit constructors are defined in the source. Use the implicit default constructor or initialize fields via object initializer syntax.
Methods
- (none)
There are no methods or instance behavior on this type — it is pure data for ECS consumption.
Usage Example
using Unity.Entities;
using Game.Prefabs;
using Game.Audio.Radio; // for Radio.SegmentType
// Example inside a SystemBase or wherever you have an EntityManager:
EntityManager em = World.DefaultGameObjectInjectionWorld.EntityManager;
// Prepare an archetype for the radio segment entity (example components)
EntityArchetype archetype = em.CreateArchetype(
typeof(Translation),
typeof(Rotation),
typeof(RadioPlaybackComponent) // hypothetical component the radio system expects
);
// Create a RadioEventData struct and set fields
RadioEventData radioEvent = new RadioEventData
{
m_Archetype = archetype,
m_SegmentType = Radio.SegmentType.MusicJingle, // example enum value
m_EmergencyFrameDelay = 0
};
// Attach the component to an entity (create a new marker entity)
Entity e = em.CreateEntity(typeof(RadioEventData));
em.SetComponentData(e, radioEvent);
// Alternatively, create and assign in one step:
Entity e2 = em.CreateEntity();
em.AddComponentData(e2, new RadioEventData
{
m_Archetype = archetype,
m_SegmentType = Radio.SegmentType.Advert,
m_EmergencyFrameDelay = 120
});
Notes: - RadioEventData is a POD-style ECS component. Systems should read it and perform entity creation/logic on the main thread or via appropriate Jobs/CommandBuffers. - The precise semantics of m_SegmentType and m_EmergencyFrameDelay depend on the radio/audio systems that consume this component; consult those systems for exact behavior.