Game.Pathfind.DensityActionData
Assembly:
Assembly-CSharp (game/mod assembly)
Namespace:
Game.Pathfind
Type:
struct
Base:
System.ValueType
Summary:
DensityActionData is a simple data container used by the pathfinding code to associate a density value with an owner entity. It is a plain C# struct with two public fields: an Entity reference identifying the owner and a float representing the density value used by pathfinding or related systems. This struct does not implement any Unity ECS interfaces (e.g., IComponentData) in its current form; it is used wherever lightweight, non-behavioral data needs to be passed around inside the pathfinding subsystem.
Fields
-
public Unity.Entities.Entity m_Owner
Holds the Entity that "owns" or is associated with this density entry. Typically used to identify which entity the density value applies to within pathfinding logic. -
public float m_Density
A floating-point density value. Interpretation depends on calling code (for example, could represent traffic density, weight for path selection, or occupancy).
Properties
- None.
This struct exposes only public fields; there are no properties defined.
Constructors
- Default (implicit) parameterless constructor
As a C# struct, DensityActionData has an implicit default constructor that initializes m_Owner to the default Entity value and m_Density to 0.0f. There are no explicit constructors defined in the source.
Methods
- None.
There are no methods defined on this struct.
Usage Example
using Unity.Entities;
using Game.Pathfind;
// create and initialize
var entry = new DensityActionData
{
m_Owner = someEntity, // Unity.Entities.Entity obtained from the ECS world
m_Density = 0.75f
};
// use in pathfinding logic (example)
ProcessDensityEntry(entry);
void ProcessDensityEntry(DensityActionData e)
{
// read e.m_Owner and e.m_Density and apply whatever logic is required
}
Notes: - If you intend to store this struct as a component on entities in Unity DOTS, convert it to implement IComponentData or use an appropriate wrapper. - Keep the struct small and blittable for best performance when passing in high-frequency systems.