Skip to content

Game.Prefabs.VehicleData

Assembly:
Assembly not specified in source (typically part of the game's main assembly, e.g. Assembly-CSharp)

Namespace:
Game.Prefabs

Type:
struct (value type)

Base:
System.ValueType

Summary:
VehicleData is a small ECS component struct used by the game's entity systems to store an integer index that identifies which steering bone (or steering joint) a vehicle uses for animation/steering logic. It implements Unity.Entities.IComponentData so it can be attached to DOTS entities, IQueryTypeParameter to participate in query type parameterization, and Colossal.Serialization.Entities.IEmptySerializable to integrate with the game's custom serialization pipeline.


Fields

  • public int m_SteeringBoneIndex
    Index of the steering bone for the vehicle. This value is used by vehicle animation/steering systems to look up the bone/joint that should be rotated when steering. Typical usage: 0-based index into a prefab's bone list; a value of 0 often means the first bone or "no special bone" depending on the prefab setup. Set this to the appropriate bone index for the vehicle model.

Properties

  • This struct does not declare any properties. It's a plain component struct with a single public field.

Constructors

  • public VehicleData() (implicit default)
    As a C# struct, VehicleData has the implicit parameterless constructor provided by the runtime which initializes m_SteeringBoneIndex to 0. No custom constructors are declared in source.

Methods

  • This type does not declare any methods. It is a simple data container component.

Usage Example

// Create an entity with the VehicleData component and set the steering bone index
var entityManager = World.DefaultGameObjectInjectionWorld.EntityManager;
var archetype = entityManager.CreateArchetype(typeof(Game.Prefabs.VehicleData));
var entity = entityManager.CreateEntity(archetype);

// Assign steering bone index (e.g. index 2)
entityManager.SetComponentData(entity, new Game.Prefabs.VehicleData { m_SteeringBoneIndex = 2 });

Additional notes: - Because this implements IComponentData, the component is suitable for high-performance DOTS systems and should be used with Unity.Entities APIs. - IQueryTypeParameter support allows the type to be referenced in query parameter lists in systems where appropriate. - IEmptySerializable is used by the game's custom serialization/streaming systems; the presence of that interface typically lets the game's serializer handle this type in its entity serialization pipeline.