Skip to content

Game.Prefabs.NetArrowData

Assembly: Game
Namespace: Game.Prefabs

Type: struct

Base: IComponentData, IQueryTypeParameter, IEmptySerializable

Summary:
NetArrowData is a lightweight ECS component used to store rendering parameters for "net arrows" (direction/overlay markers) in the game. It contains per-arrow color data for road and track visuals and an integer index selecting the material used for rendering. The struct is plain data (no behavior) and is suitable for use with Unity's DOTS/ECS queries and serialization markers used by the game.


Fields

  • public UnityEngine.Color32 m_RoadColor
    Color used for the road arrow visual. Stored as a Color32 for compactness.

  • public UnityEngine.Color32 m_TrackColor
    Color used for the track (rail/track) arrow visual.

  • public int m_MaterialIndex
    Index identifying which material/variant to use when rendering the arrow.

Properties

  • None. This component exposes public fields and has no properties.

Constructors

  • public NetArrowData() (implicit default)
    No explicit constructors are declared in the source. The implicit parameterless constructor is available and you can initialize instances using an object initializer.

Methods

  • None. This type is a plain data container. The implemented interfaces are marker/interfaces for ECS usage and (de)serialization; there are no instance methods defined.

Usage Example

using Unity.Entities;
using UnityEngine;
using Game.Prefabs;

// Create and initialize the component
var arrowData = new NetArrowData {
    m_RoadColor = new Color32(255, 0, 0, 255),   // red for road
    m_TrackColor = new Color32(0, 255, 0, 255),  // green for track
    m_MaterialIndex = 2
};

// Add to an entity
EntityManager entityManager = World.DefaultGameObjectInjectionWorld.EntityManager;
entityManager.AddComponentData(someEntity, arrowData);

// Read later
NetArrowData readBack = entityManager.GetComponentData<NetArrowData>(someEntity);

Notes: - The IQueryTypeParameter interface lets this component be used directly in query type parameters for systems that process entities with arrow data. - IEmptySerializable is a marker used by the game's serialization framework; no custom serialization code is required in this struct.