Game.Prefabs.FireConfigurationData
Assembly: Assembly-CSharp
Namespace: Game.Prefabs
Type: struct
Base: IComponentData, IQueryTypeParameter
Summary:
A plain ECS component containing fire-related configuration values used by the game's fire simulation and building-fire systems. This struct holds references to notification prefabs, multiple structural integrity thresholds, response-time ranges and modifiers, and the fatality/death rate for fire accidents. It's intended to be attached to entities (for example: a service or global settings entity) so systems can read these configuration values during simulation and event handling.
Fields
-
public Entity m_FireNotificationPrefab
Entity reference to the prefab used for showing a fire notification (e.g., when a fire is reported). This should be a valid prefab Entity; systems instantiate or trigger this prefab to produce UI/visual feedback. -
public Entity m_BurnedDownNotificationPrefab
Entity reference to the prefab used when a building has burned down. Similar to m_FireNotificationPrefab but used for the more severe "burned down" event. -
public float m_DefaultStructuralIntegrity
Base structural integrity value used as a default when no building-specific integrity is defined. Units are relative hit/strength points — higher values mean a building is harder to burn down. -
public float m_BuildingStructuralIntegrity
Default structural integrity applied specifically to generic buildings (may be overridden by specific building types). Used by the fire damage and collapse logic. -
public float m_StructuralIntegrityLevel1
Structural integrity threshold/value for level 1 buildings or condition tier 1. The meaning depends on how systems map these level thresholds to building classes; commonly used for progressive deterioration or fire resistance tiers. -
public float m_StructuralIntegrityLevel2
Structural integrity threshold/value for level 2 buildings / tier 2. -
public float m_StructuralIntegrityLevel3
Structural integrity threshold/value for level 3 buildings / tier 3. -
public float m_StructuralIntegrityLevel4
Structural integrity threshold/value for level 4 buildings / tier 4. -
public float m_StructuralIntegrityLevel5
Structural integrity threshold/value for level 5 buildings / tier 5. -
public Bounds1 m_ResponseTimeRange
Range (min/max) for emergency response time. Bounds1 typically encodes a minimum and maximum float; systems should sample or clamp response times within this range. Units are seconds (time to dispatch/arrive), unless the consuming system expects other units — verify with the target system. -
public float m_TelecomResponseTimeModifier
Multiplier applied to response time when telecom conditions affect dispatch (for example, faster or slower reporting). Typical values: 1.0 = no change, <1.0 = faster responses, >1.0 = slower responses. -
public float m_DarknessResponseTimeModifier
Multiplier applied to response times during darkness/night conditions (or low visibility). Typical usage: increases response time at night (value > 1.0) unless town lighting or other factors reduce it. -
public float m_DeathRateOfFireAccident
Fractional death rate for fire accidents (probability between 0 and 1). Represents the chance an occupant will die in a fire accident; used by casualty/fatality calculations. Values should be kept in a reasonable range (e.g., 0.0 to 1.0).
Properties
- None (this is a pure data component with public fields; no properties are declared).
Constructors
public FireConfigurationData()
Default parameterless constructor (value-type default). When constructed without parameters, numeric fields are zero-initialized and Entity fields are set to Entity.Null. Typical usage is to create an instance and set the needed fields explicitly or use object initializer syntax.
Methods
- None (no methods are declared on this data struct). The struct implements IComponentData and IQueryTypeParameter so it is usable in Unity.Entities queries and systems.
Usage Example
// Creating and adding the component to an entity (e.g., a global settings entity)
var fireCfg = new FireConfigurationData
{
m_FireNotificationPrefab = fireNotifEntity,
m_BurnedDownNotificationPrefab = burnedNotifEntity,
m_DefaultStructuralIntegrity = 100f,
m_BuildingStructuralIntegrity = 120f,
m_StructuralIntegrityLevel1 = 50f,
m_StructuralIntegrityLevel2 = 75f,
m_StructuralIntegrityLevel3 = 100f,
m_StructuralIntegrityLevel4 = 150f,
m_StructuralIntegrityLevel5 = 200f,
m_ResponseTimeRange = new Bounds1(20f, 120f), // min 20s, max 120s
m_TelecomResponseTimeModifier = 0.95f,
m_DarknessResponseTimeModifier = 1.2f,
m_DeathRateOfFireAccident = 0.02f
};
entityManager.AddComponentData(settingsEntity, fireCfg);
// Reading the component inside a system
Entities
.ForEach((ref FireConfigurationData cfg) =>
{
// Use cfg.m_ResponseTimeRange, cfg.m_TelecomResponseTimeModifier, etc.
})
.Run();
Notes and tips: - Since this is an IComponentData struct, keep it as a POD (plain-old-data) container and avoid adding behavior methods to it. - Ensure prefab Entity references are valid and created/converted before systems attempt to instantiate them. - When changing these values in a mod, consider compatibility and reasonable default ranges so gameplay balance isn't unintentionally broken.