Skip to content

Game.Prefabs.RenderedAreaData

Assembly: Assembly-CSharp
Namespace: Game.Prefabs

Type: struct

Base: Implements Unity.Entities.IComponentData, Unity.Entities.IQueryTypeParameter

Summary:
RenderedAreaData is a plain-data ECS component used by the game's rendering/prefab systems to describe per-area rendering parameters. It encodes small tuning values that affect height offset, expansion margin, level-of-detail bias and batching for a rendered area (tile/patch). As an IComponentData it can be attached to entities, and as an IQueryTypeParameter it is intended to be usable directly in ECS queries or systems that iterate/operate on rendered-area entities.


Fields

  • public float m_HeightOffset
    This value offsets the visual height of the rendered area. Typically used to lift geometry slightly to avoid z-fighting or to align overlays with terrain/structures. Units are game world units (meters). Default is implementation-dependent (likely 0).

  • public float m_ExpandAmount
    How much the rendered area should be expanded (in world units) beyond its nominal bounds. Useful for avoiding clipping at tile edges when objects or effects extend slightly outside the area. Positive values expand outward; negative values would shrink. Default is implementation-dependent.

  • public float m_LodBias
    Level-of-detail (LOD) bias for this rendered area. Larger values favor lower-detail LODs sooner; smaller (or negative) values favor higher-detail LODs. This allows per-area control over LOD selection for performance vs. quality trade-offs.

  • public int m_BatchIndex
    Integer index used for grouping/batching rendered areas. Areas with the same batch index may be processed or drawn together to reduce draw calls. The exact batching semantics depend on the renderer's batching implementation.

Properties

  • This struct exposes no C# properties beyond the public fields. It is a plain data container.

Constructors

  • public RenderedAreaData()
    Structs have a default parameterless constructor generated by C#. You can initialize instances via object initializer syntax, e.g.:
var data = new RenderedAreaData {
    m_HeightOffset = 0.1f,
    m_ExpandAmount = 2f,
    m_LodBias = 0f,
    m_BatchIndex = 0
};

Methods

  • This type defines no methods. It is intended purely as an ECS data component.

Usage Example

// Add the component to an entity (EntityManager API)
var renderedArea = new RenderedAreaData {
    m_HeightOffset = 0.05f,
    m_ExpandAmount = 1.5f,
    m_LodBias = -0.5f,
    m_BatchIndex = 3
};
entityManager.AddComponentData(someEntity, renderedArea);

// Or in a SystemBase: read/update components in a job/for-each
Entities
    .WithName("RenderedAreaAdjust")
    .ForEach((ref RenderedAreaData area) =>
    {
        // Example: slightly increase expand amount for debug/visualization
        area.m_ExpandAmount += 0.1f;
    }).ScheduleParallel();

Notes: - Values and semantics are driven by the game's renderer and prefab systems; experiment in small changes when modding to avoid visual artifacts. - Because this is an ECS component, prefer system-based updates and queries rather than direct polling from non-ECS code.