Game.Prefabs.OutsideConnectionData
Assembly: Assembly-CSharp (game runtime assembly)
Namespace: Game.Prefabs
Type: struct
Base: IComponentData, IQueryTypeParameter
Summary:
Component data used by the ECS to represent an outside connection attached to a prefab. Contains the transfer category (what type of traffic or goods the outside connection carries) and a remoteness value used by routing/selection logic, spawn heuristics or priority decisions in the outside-connection systems.
Fields
-
public OutsideConnectionTransferType m_Type
The transfer category for this outside connection. This is an enum (OutsideConnectionTransferType) that classifies the kind of transfer the connection handles (e.g., passengers, goods, services). Systems use this to match demand/offer and to route or spawn appropriate vehicles. -
public float m_Remoteness
A floating-point remoteness metric used by outside-connection logic. Typically represents a distance/priority heuristic (higher or lower values depending on system convention) that influences selection, spawning frequency, or routing preference. Units/scale are defined by the simulation code that consumes this value.
Properties
- None — this is a plain IComponentData struct exposing public fields.
Constructors
public OutsideConnectionData()
Implicit parameterless constructor provided by C#. Create instances using object initializers or by assigning fields directly.
Methods
- None — no methods are defined on this struct.
Usage Example
using Unity.Entities;
using Game.Prefabs;
// Create and assign component data to an entity
var ocData = new OutsideConnectionData
{
m_Type = OutsideConnectionTransferType.Passenger,
m_Remoteness = 250f
};
entityManager.AddComponentData(entity, ocData);
// Query example in a System (read/write)
Entities.ForEach((ref OutsideConnectionData oc) =>
{
if (oc.m_Remoteness > 200f)
{
// perform logic for more-remote outside connections
}
}).Schedule();