Skip to content

Game.Prefabs.GarbageParameterData

Assembly: Assembly-CSharp
Namespace: Game.Prefabs

Type: struct

Base: System.ValueType, Unity.Entities.IComponentData, Unity.Entities.IQueryTypeParameter

Summary:
Container component that stores configuration parameters for the game's garbage service/prefab behavior. This struct holds references to service and notification prefabs and a set of numeric thresholds and balances that drive garbage production, collection limits, accumulation caps, and happiness effects related to garbage in the city. It is intended to be attached as an ECS component to an entity that represents garbage system configuration.


Fields

  • public Unity.Entities.Entity m_GarbageServicePrefab
    Reference to the garbage service prefab Entity used to spawn or represent garbage collection facilities or service-specific behavior.

  • public Unity.Entities.Entity m_GarbageNotificationPrefab
    Reference to the prefab Entity used to display notifications related to garbage (e.g., alerts when garbage issues arise).

  • public Unity.Entities.Entity m_FacilityFullNotificationPrefab
    Reference to the prefab Entity used to display notifications when a facility (e.g., landfill/garbage facility) becomes full.

  • public int m_HomelessGarbageProduce
    Amount of garbage produced by homeless population units or similar sources. Unit is game-specific (usually a per-tick or per-event integer count).

  • public int m_CollectionGarbageLimit
    Threshold representing how much garbage a collection service will collect in a single operation or before some behavior changes (e.g., triggers more collections).

  • public int m_RequestGarbageLimit
    Threshold used to determine when requests for additional garbage collection are issued (e.g., when accumulated garbage exceeds this value).

  • public int m_WarningGarbageLimit
    Garbage amount at which the system issues warnings (such as UI notifications or status changes) before hitting critical accumulation.

  • public int m_MaxGarbageAccumulation
    Maximum garbage accumulation allowed before overflow behavior or penalties occur (e.g., reduced happiness or other consequences).

  • public float m_BuildingLevelBalance
    Multiplier or balance factor applied based on building level; used to scale garbage production/handling according to building tiers.

  • public float m_EducationBalance
    Multiplier or balance factor applied based on citizen education levels; typically reduces or increases garbage production/requirements depending on education.

  • public int m_HappinessEffectBaseline
    Baseline happiness effect applied from garbage conditions (e.g., baseline penalty or bonus before applying steps).

  • public int m_HappinessEffectStep
    Incremental happiness change per step of garbage severity; used to scale how much happiness is affected as garbage problems increase.

Properties

  • None. This is a plain data struct with public fields.

Constructors

  • public GarbageParameterData()
    Default value-type constructor. All fields will be default-initialized (Entity.Zero for Entity fields, 0 for int fields, 0.0f for float fields). Initialize explicit values when creating an instance to use meaningful parameters.

Methods

  • None. This struct is only a data container and does not provide behavior methods.

Usage Example

// Example: creating and assigning a GarbageParameterData component to an entity
var world = Unity.Entities.World.DefaultGameObjectInjectionWorld;
var em = world.EntityManager;

Entity configEntity = em.CreateEntity();

// Set up a GarbageParameterData instance with desired values
var garbageParams = new Game.Prefabs.GarbageParameterData
{
    m_GarbageServicePrefab = someServicePrefabEntity,
    m_GarbageNotificationPrefab = someNotificationPrefabEntity,
    m_FacilityFullNotificationPrefab = someFullPrefabEntity,
    m_HomelessGarbageProduce = 2,
    m_CollectionGarbageLimit = 100,
    m_RequestGarbageLimit = 60,
    m_WarningGarbageLimit = 40,
    m_MaxGarbageAccumulation = 1000,
    m_BuildingLevelBalance = 1.0f,
    m_EducationBalance = 0.9f,
    m_HappinessEffectBaseline = -5,
    m_HappinessEffectStep = -2
};

// Add the component to the entity
em.AddComponentData(configEntity, garbageParams);