Skip to content

Game.Prefabs.InfoviewAvailabilityData

Assembly: Assembly-CSharp (game assembly)
Namespace: Game.Prefabs

Type: struct

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

Summary:
A small ECS component used by prefabs to declare when an in-game "infoview" (an information overlay) is available. It records which zone/area type the infoview is associated with and whether the availability applies to office buildings. This is a plain data component (blittable) intended to be attached to entities/prefabs and consumed by systems or queries that determine UI/overlay availability.


Fields

  • public Game.Zones.AreaType m_AreaType
    Indicates the area/zone type this infoview availability applies to. Replace with the appropriate AreaType enum value defined in Game.Zones (for example Residential/Commercial/Industrial/Office or the equivalent values present in the game).

  • public System.Boolean m_Office
    When true, marks that the infoview availability applies to office buildings (or office-type areas). When false, it does not apply to offices.

Properties

  • This type defines no properties; it only exposes public fields.

Constructors

  • public InfoviewAvailabilityData()
    Implicit default struct constructor. Default values are the AreaType default (enum default value) and m_Office = false. You can create and set values via object initializer when adding the component.

Methods

  • This type defines no methods.

Usage Example

using Game.Prefabs;
using Game.Zones; // AreaType
using Unity.Entities;

// Add component to an entity (example)
var entityManager = World.DefaultGameObjectInjectionWorld.EntityManager;
var archetype = entityManager.CreateArchetype(typeof(InfoviewAvailabilityData));
var entity = entityManager.CreateEntity(archetype);

entityManager.SetComponentData(entity, new InfoviewAvailabilityData
{
    // Replace AreaType.Residential with the actual enum value you need.
    m_AreaType = AreaType.Residential,
    m_Office = false
});

// Querying / reading the component in a SystemBase
public partial class InfoviewAvailabilitySystem : SystemBase
{
    protected override void OnUpdate()
    {
        Entities
            .WithAll<InfoviewAvailabilityData>()
            .ForEach((ref InfoviewAvailabilityData info) =>
            {
                // Use info.m_AreaType and info.m_Office to drive UI/overlay logic.
                if (info.m_Office)
                {
                    // handle office-specific infoview availability
                }
            })
            .Schedule();
    }
}

Notes: - This component is intended for data-only usage in ECS workflows; modify or extend it only if you understand the effects on systems that consume it. - Replace placeholder enum values in examples with the actual AreaType members defined in your game's codebase.