Skip to content

Game.BackSide

Assembly:
Unknown (not specified in source file)
Namespace: Game.Buildings

Type: struct

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

Summary:
BackSide is a lightweight ECS component used to store information about the "back side" of a building related to a road edge. It holds an Entity reference to a road-edge entity and a float describing a position along a curve (for example, a normalized position along the road/edge). Being an IComponentData, it is a blittable component that can be attached to entities; implementing IQueryTypeParameter indicates it can be used in ECS query contexts.


Fields

  • public Unity.Entities.Entity m_RoadEdge
    Holds a reference to another entity that represents the associated road edge. This can be used to look up road geometry, signals, or other road-edge specific components.

  • public System.Single m_CurvePosition
    A floating-point value representing the position along a curve/edge. Typical usage is a normalized value (0..1) but the code does not enforce range — interpretation depends on the consuming systems.

Properties

  • This type has no properties.

Constructors

  • Implicit default constructor (value-type semantics)
    Structs in C# have an implicit parameterless constructor that zero-initializes fields. You can initialize it with an object initializer when adding the component.

Methods

  • This type declares no methods.

Usage Example

// Create and add the component to an entity using EntityManager
var backSide = new Game.Buildings.BackSide
{
    m_RoadEdge = roadEdgeEntity,   // Entity reference to the road edge
    m_CurvePosition = 0.5f         // halfway along the curve
};
entityManager.AddComponentData(buildingEntity, backSide);

// Read/update in a system (example using Entities.ForEach in a ComponentSystemBase/Systems)
Entities
    .ForEach((ref Game.Buildings.BackSide bs) =>
    {
        // Use bs.m_RoadEdge and bs.m_CurvePosition here
        // e.g., resolve additional components from m_RoadEdge via EntityManager if needed
    })
    .Schedule();

Notes: - Ensure you have the Unity.Entities using/imports present when working with the component. - Because m_RoadEdge is an Entity, dereferencing related data requires querying the EntityManager or using proper entity queries in systems.