Game.Prefabs.PoliceConfigurationData
Assembly: Assembly-CSharp
Namespace: Game.Prefabs
Type: struct
Base: IComponentData, IQueryTypeParameter
Summary:
Component data struct used by the ECS (DOTS) systems to configure police-related prefabs and tuning values for the crime simulation. It stores references to prefab entities (service and notification prefabs) and several numeric parameters that influence how crime accumulates, recurs and is mitigated by police coverage and population effects. This struct is intended to be attached to a configuration or prefab entity so systems can read global police/crime configuration values.
Fields
-
public Entity m_PoliceServicePrefab
Reference to the police service prefab entity. Systems will instantiate or reference this entity when spawning police service objects (e.g., police stations or service instances). -
public Entity m_TrafficAccidentNotificationPrefab
Reference to the notification prefab used for traffic accident events (notifications/visuals created when accidents occur). -
public Entity m_CrimeSceneNotificationPrefab
Reference to the notification prefab used for crime scene events (notifications/visuals when a crime scene is created). -
public float m_MaxCrimeAccumulation
Maximum crime accumulation value used by the crime simulation before a major event or saturation logic triggers. Unitless; higher values allow more crime to accumulate before consequences. Typical tuning: tens to hundreds depending on design. -
public float m_CrimeAccumulationTolerance
Tolerance or threshold used when evaluating incremental crime accumulation (e.g., noise/tolerance for small fluctuations). Smaller values make the system more sensitive to small changes. Typical tuning: small floats (0.1–10). -
public int m_HomeCrimeEffect
Integer effect value applied to crime accumulation coming from residential/home sources. Interpreted by the crime systems as an additive or weighted amount when computing crime contribution from homes. Typical tuning: small integers (0–50). -
public int m_WorkplaceCrimeEffect
Integer effect value applied to crime accumulation coming from workplaces. Similar usage to m_HomeCrimeEffect but for workplace-originated crime. Typical tuning: small integers (0–50). -
public float m_WelfareCrimeRecurrenceFactor
Factor controlling how quickly crime recurs in welfare/low-income contexts (a multiplier on recurrence or reappearance rates). Values usually in the range 0.0–2.0 (where <1 reduces recurrence, >1 increases it). -
public float m_CrimePoliceCoverageFactor
Multiplier that sets how effective police coverage is at reducing crime accumulation or preventing events. Higher values increase police effectiveness. Typical tuning: 0.0 (no effect) to >1.0 (strong effect). -
public float m_CrimePopulationReduction
Factor describing how population density or population-related effects reduce reported crime (e.g., a per-capita reduction factor). Usually represented as a small fraction (0.0–1.0) indicating proportionate reduction.
Properties
This type exposes no C# properties — it is a plain IComponentData struct with public fields.
Constructors
public PoliceConfigurationData()
Default value-type constructor (implicitly available). Populate fields directly when creating instances. There is no custom explicit constructor defined in the source.
Methods
This struct defines no methods. It implements IComponentData for use with Unity.Entities and IQueryTypeParameter to allow usage in queries where appropriate.
Usage Example
// Example: creating and adding configuration data to a configuration entity
var policeConfig = new PoliceConfigurationData
{
m_PoliceServicePrefab = policeServiceEntity,
m_TrafficAccidentNotificationPrefab = trafficAccidentNotifEntity,
m_CrimeSceneNotificationPrefab = crimeSceneNotifEntity,
m_MaxCrimeAccumulation = 150f,
m_CrimeAccumulationTolerance = 2.5f,
m_HomeCrimeEffect = 12,
m_WorkplaceCrimeEffect = 8,
m_WelfareCrimeRecurrenceFactor = 0.6f,
m_CrimePoliceCoverageFactor = 1.0f,
m_CrimePopulationReduction = 0.02f
};
entityManager.AddComponentData(configurationEntity, policeConfig);
Notes: - Values and typical ranges above are guidance for modders; the exact interpretation depends on the game's crime systems that consume this data. - Because this is an ECS component, read/write access should typically occur from systems using proper synchronization patterns (e.g., in system update methods or via commands).