Skip to content

Game.Net.LaneColor

Assembly: Assembly-CSharp (typical game assembly; adjust if different)
Namespace: Game.Net

Type: struct

Base: System.ValueType

Summary: A small Unity.Entities component used by the game's ECS to store compact lane color data. The struct implements IComponentData so it can be attached to entities, IQueryTypeParameter to be usable in queries, and IEmptySerializable to participate in the game's/custom serialization system. It holds an index (likely a palette or slot index) and two byte values representing color-related values for the lane (exact interpretation depends on how the game encodes lane color — e.g., channel values, palette entries, or compressed color data).


Fields

  • public byte m_Index Used to select which lane color slot or palette entry this component refers to (interpreted by game code/systems).

  • public byte m_Value0 First byte of color data for this lane. The meaning depends on the game's encoding (could be a color channel, palette index, or compressed value).

  • public byte m_Value1 Second byte of color data for this lane. Together with m_Value0 (and m_Index) represents the lane's color information as expected by the consuming systems.

Properties

  • This struct does not declare any properties.

Constructors

  • public LaneColor(byte index, byte value0, byte value1) Initializes a LaneColor instance with the given index and two value bytes. Parameters:
  • index: index or slot identifier for the lane color.
  • value0: first color/value byte.
  • value1: second color/value byte.

Methods

  • This struct does not declare any methods.

Usage Example

using Unity.Entities;
using Game.Net;

// Add a LaneColor component to an existing entity (inside a SystemBase)
public partial class LaneColorExampleSystem : SystemBase
{
    protected override void OnUpdate()
    {
        var em = EntityManager;

        // Example: for each entity with some marker, add a lane color
        Entities
            .WithNone<LaneColor>() // add only if not present
            .ForEach((Entity entity, in SomeMarkerTag marker) =>
            {
                // Example values: index = 0, value0 = 200, value1 = 150
                em.AddComponentData(entity, new LaneColor(0, 200, 150));
            })
            .WithoutBurst()
            .Run();
    }
}

{{ The LaneColor struct is intentionally minimal and low-level — concrete interpretation of the fields (palette index vs. channel values) depends on the game's lane rendering/coloring systems. When creating or reading this component in mod code, inspect or reuse existing game systems to ensure correct encoding/decoding of the color bytes. }}