Game.Pathfind.FlowActionData
Assembly: Assembly-CSharp (game code)
Namespace: Game.Pathfind
Type: struct (public)
Base: System.ValueType
Summary:
Lightweight POD (plain-old-data) struct used by the pathfinding/flow system to represent a single "flow action" record. It holds a reference to the owning ECS Entity and a small numeric offset used by the flow/pathfinding logic (typically an index or delta). This struct is suitable for use in ECS containers and jobs (blittable types), but requires Unity.Entities to be referenced.
Fields
-
public Unity.Entities.Entity m_Owner
Holds the Entity that owns or is associated with this flow action. The value should be treated as an ECS Entity handle — verify entity validity (with EntityManager or EntityQuery) before dereferencing or using it. -
public byte m_FlowOffset
A compact byte used by the flow system as an offset/index/delta. Range 0–255; semantics depend on the internal flow/pathfinding implementation (e.g., an index into flow arrays or a small signed offset encoded in a byte).
Properties
- None. This struct exposes only public fields.
Constructors
public FlowActionData()
Implicit default struct constructor provided by C#. Fields are zero-initialized (m_Owner = default Entity, m_FlowOffset = 0). You can also initialize with an object initializer.
Methods
- None. This is a plain data container with no behavior.
Usage Example
using Unity.Entities;
using Game.Pathfind;
// create and initialize
FlowActionData action = new FlowActionData {
m_Owner = someEntity, // a valid Unity.Entities.Entity
m_FlowOffset = 5 // example offset/index
};
// or inline
var actions = new NativeList<FlowActionData>(Allocator.Temp);
actions.Add(new FlowActionData { m_Owner = someEntity, m_FlowOffset = 2 });
// When using the Entity value, ensure the entity is valid in the current world:
// if (entityManager.Exists(action.m_Owner)) { ... }
Additional notes: - This struct is intended for internal/pathfinding flow data and should be used in contexts where small, blittable records are required (Native containers, job data). - Make sure Unity.Entities (DOTS) APIs are available in your mod project to work with Entity types.