Skip to content

Game.Triggers.RadioTag

Assembly:
Namespace: Game.Triggers

Type: struct

Base: System.ValueType, System.IEquatable

Summary:
RadioTag is a lightweight value-type used by the game's trigger/radio systems to associate a radio event with a target entity and a segment type. It also carries an integer frame delay that appears to be used for emergency timing. The struct implements IEquatable to provide a value equality check used by game systems.


Fields

  • public Unity.Entities.Entity m_Event
    Holds the Entity that represents the radio event source or descriptor. Typically used to identify which radio event is being referenced.

  • public Unity.Entities.Entity m_Target
    Holds the Entity that is the target of the radio event (for example, the recipient or object affected by the event).

  • public Game.Audio.Radio.SegmentType m_SegmentType
    An enum value (from Game.Audio.Radio) describing the segment type of the radio event. Determines which audio segment or category the tag refers to.

  • public int m_EmergencyFrameDelay
    An integer specifying a frame delay used for emergency-related timing. Note: this field is NOT considered by the struct's Equals(RadioTag) implementation (see Methods).

Properties

  • This type has no properties.

Constructors

  • public RadioTag()
    As a value type, RadioTag has the implicit default parameterless constructor which initializes fields to their default values (entities default to Entity.Null, enums to their zero value, ints to 0). Instances are commonly created with object initializers to set fields explicitly.

Methods

  • public bool Equals(RadioTag other)
    Implements IEquatable. Returns true when m_Event, m_Target, and m_SegmentType are equal to those in other. Important: m_EmergencyFrameDelay is not compared, so two RadioTag instances with different emergency delays can be considered equal by this method. If you rely on full-value equality (including emergency delay) or plan to use RadioTag as a key in hashed collections, consider this behavior and implement a more complete equality / GetHashCode if needed.

Usage Example

using Unity.Entities;
using Game.Triggers;
using Game.Audio.Radio;

// create a tag and set fields
var tagA = new RadioTag
{
    m_Event = someEventEntity,
    m_Target = someTargetEntity,
    m_SegmentType = Radio.SegmentType.Alert,
    m_EmergencyFrameDelay = 10
};

var tagB = new RadioTag
{
    m_Event = someEventEntity,
    m_Target = someTargetEntity,
    m_SegmentType = Radio.SegmentType.Alert,
    m_EmergencyFrameDelay = 0
};

// Equals returns true because m_EmergencyFrameDelay is ignored by Equals
bool equal = tagA.Equals(tagB); // true

// If you need to compare delays as well:
bool fullyEqual = tagA.m_Event == tagB.m_Event
    && tagA.m_Target == tagB.m_Target
    && tagA.m_SegmentType == tagB.m_SegmentType
    && tagA.m_EmergencyFrameDelay == tagB.m_EmergencyFrameDelay;