Game.Prefabs.WaterPipeParameterData
Assembly:
Assembly-CSharp (typical runtime assembly for game code — not explicitly declared in source)
Namespace:
Game.Prefabs
Type:
struct
Base:
IComponentData, IQueryTypeParameter
Summary:
Component data that groups references to water-related service and notification entities and a collection of configuration parameters used by the water/ sewage/pumping simulation for a water pipe prefab. This struct is used by the game's ECS systems to find notification prefabs (entities) for various water events and to control numeric behaviour such as groundwater replenishment, pump effectiveness, pollution tolerance and related multipliers. Many numeric fields represent rates, multipliers or thresholds used by pipe, pump and water service logic; exact units are determined by the consuming systems in the game code.
Fields
-
public Entity m_WaterService
Reference to the water service entity (service/system/provider) associated with the pipe/prefab. -
public Entity m_WaterNotification
Entity (prefab) used to spawn a notification when a normal water-related event occurs (e.g., water delivered). -
public Entity m_DirtyWaterNotification
Entity (prefab) used to spawn a notification for dirty water events (pollution-related). -
public Entity m_SewageNotification
Entity (prefab) used to spawn sewage-related notifications. -
public Entity m_WaterPipeNotConnectedNotification
Entity (prefab) used to notify when a water pipe is not connected. -
public Entity m_SewagePipeNotConnectedNotification
Entity (prefab) used to notify when a sewage pipe is not connected. -
public Entity m_NotEnoughWaterCapacityNotification
Entity (prefab) used to notify when there is insufficient water capacity. -
public Entity m_NotEnoughSewageCapacityNotification
Entity (prefab) used to notify when there is insufficient sewage capacity. -
public Entity m_NotEnoughGroundwaterNotification
Entity (prefab) used to notify when groundwater is insufficient. -
public Entity m_NotEnoughSurfaceWaterNotification
Entity (prefab) used to notify when surface water is insufficient. -
public Entity m_DirtyWaterPumpNotification
Entity (prefab) used to notify when a pump is producing or handling dirty water. -
public float m_GroundwaterReplenish
Rate at which groundwater is replenished. Interpreted by water systems as a replenishment rate per simulation step or per second depending on the consuming code. -
public int m_GroundwaterPurification
Integer value representing groundwater purification capacity or amount applied during purification logic (exact interpretation depends on consuming system). -
public float m_GroundwaterUsageMultiplier
Multiplier applied to groundwater usage (e.g., increases or reduces how fast groundwater is consumed by pumps). -
public float m_GroundwaterPumpEffectiveAmount
Effective amount of groundwater a pump can extract (per operation/interval), used by pump logic to compute extracted volume. -
public float m_SurfaceWaterUsageMultiplier
Multiplier applied to surface water usage (affects how surface water is consumed). -
public float m_SurfaceWaterPumpEffectiveDepth
Parameter used by surface-water pumping logic (likely affects pump effectiveness relative to water depth). -
public float m_MaxToleratedPollution
Pollution threshold tolerated by the pipe/system before negative effects occur. Value range and units are determined by simulation code. -
public int m_WaterPipePollutionSpreadInterval
Interval (in simulation ticks/steps) used to control how frequently pollution spreads through water pipes. -
public float m_StaleWaterPipePurification
Rate at which stale water inside pipes is purified over time (applied per interval by the simulation).
Properties
This type has no properties; it exposes plain public fields.
Constructors
public WaterPipeParameterData()
Default implicit struct constructor. All Entity fields default to Entity.Null and numeric fields default to zero. Initialize fields explicitly before use to avoid zero/Null behaviour where inappropriate.
Methods
This type declares no methods. It acts purely as data storage for ECS systems.
Usage Example
using Unity.Entities;
using UnityEngine;
public class WaterPipeAuthoringExample : MonoBehaviour, IConvertGameObjectToEntity
{
public GameObject waterServicePrefab;
public GameObject waterNotificationPrefab;
// ... other prefab references and numeric settings ...
public float groundwaterReplenish = 0.1f;
public int groundwaterPurification = 5;
public float groundwaterUsageMultiplier = 1.0f;
public float groundwaterPumpEffectiveAmount = 10f;
public float surfaceWaterUsageMultiplier = 1.0f;
public float surfaceWaterPumpEffectiveDepth = 5f;
public float maxToleratedPollution = 0.25f;
public int waterPipePollutionSpreadInterval = 300;
public float staleWaterPipePurification = 0.02f;
public void Convert(Entity entity, EntityManager dstManager, GameObjectConversionSystem conversionSystem)
{
var data = new Game.Prefabs.WaterPipeParameterData
{
m_WaterService = conversionSystem.GetPrimaryEntity(waterServicePrefab),
m_WaterNotification = conversionSystem.GetPrimaryEntity(waterNotificationPrefab),
// set other notification entity references similarly...
m_GroundwaterReplenish = groundwaterReplenish,
m_GroundwaterPurification = groundwaterPurification,
m_GroundwaterUsageMultiplier = groundwaterUsageMultiplier,
m_GroundwaterPumpEffectiveAmount = groundwaterPumpEffectiveAmount,
m_SurfaceWaterUsageMultiplier = surfaceWaterUsageMultiplier,
m_SurfaceWaterPumpEffectiveDepth = surfaceWaterPumpEffectiveDepth,
m_MaxToleratedPollution = maxToleratedPollution,
m_WaterPipePollutionSpreadInterval = waterPipePollutionSpreadInterval,
m_StaleWaterPipePurification = staleWaterPipePurification
};
dstManager.AddComponentData(entity, data);
}
}