Skip to content

Game.Prefabs.ZoneBuiltLevelUpdate

Assembly: Assembly-CSharp (game code / main Unity assembly)
Namespace: Game.Prefabs

Type: struct

Base: System.ValueType

Summary:
Represents a simple data record describing a change in the built level for a zone area. Typically used to convey which zone (Entity) changed its built level, what the previous and new built levels are, and how many squares (tiles) were affected. This struct is a plain data container; it is not marked as an ECS component type in the source shown (e.g., it does not implement IComponentData). Modders can use it as a transient message/DTO between systems or adapt it into a component/buffer if needed.


Fields

  • public Unity.Entities.Entity m_Zone
    Entity reference for the zone that experienced the built-level change. This should be the Entity representing the zone or zone block in the ECS world.

  • public int m_FromLevel
    The previous built level (before the change). Typically indicates the old density/height level.

  • public int m_ToLevel
    The new built level (after the change). Typically indicates the updated density/height level.

  • public int m_Squares
    Number of squares/tiles affected by this change (the area size impacted by the level update).

Properties

  • This type has no properties. It exposes four public fields and is a plain value struct.

Constructors

  • public ZoneBuiltLevelUpdate()
    Implicit default parameterless constructor (value-type default). You can initialize instances using an object initializer for clarity.

Example explicit initialization:

var update = new ZoneBuiltLevelUpdate {
    m_Zone = zoneEntity,
    m_FromLevel = 1,
    m_ToLevel = 2,
    m_Squares = 4
};

Methods

  • This struct declares no methods.

Usage Example

// Create and populate the record
ZoneBuiltLevelUpdate update = new ZoneBuiltLevelUpdate {
    m_Zone = zoneEntity,
    m_FromLevel = 1,
    m_ToLevel = 2,
    m_Squares = 9
};

// Example: queue or pass this struct to a system that applies visuals/logic updates
zoneChangeQueue.Enqueue(update);

// Note: if you intend to store this on an Entity as a component, adapt the type
// to implement IComponentData or wrap it in a DynamicBuffer element type.

{{ Additional info: Consider whether you want this type to be an ECS component (implement Unity.Entities.IComponentData) or a pure transient message. As a plain struct it is cheap to copy, but if used frequently between systems and stored on entities, converting it to a proper ECS component or buffer element will integrate better with the DOTS workflow. Also be mindful that Entity values are only valid inside the same EntityManager/World context. }}