Skip to content

Game.Pathfind.PathUpdated

Assembly:
Assembly-CSharp (game/mod assembly; adjust if this type is in a different mod assembly)

Namespace:
Game.Pathfind

Type:
struct

Base:
System.ValueType (implements IComponentData, IQueryTypeParameter)

Summary:
Represents a path update event as an ECS component. This struct is intended to be used as transient/event component data to notify systems that a path has been updated. It stores the owner entity that requested or owns the path and a PathEventData value containing the details of the update. Implementing IQueryTypeParameter indicates it can be used directly as a parameter in ECS queries where supported.


Fields

  • public Entity m_Owner
    The Entity that owns or requested the path associated with this event. Typically used by recipient systems to identify which object the path update belongs to.

  • public PathEventData m_Data
    Container holding the details of the path update (status, path result, indices, costs, or other event-specific fields). The exact shape and meaning depend on the PathEventData definition elsewhere in the codebase.

Properties

  • None

Constructors

  • public PathUpdated(Entity owner, PathEventData data)
    Creates a new PathUpdated event storing the provided owner entity and PathEventData payload. Use this to create and attach the event component to the relevant entity.

Methods

  • None

Usage Example

// Create a PathUpdated event and attach it to an entity using an EntityManager or within a SystemBase/ISystem context.
// Assumes PathEventData has a constructor or fields you can set; adapt as needed for your actual PathEventData type.

var pathEvent = new PathEventData
{
    // fill relevant fields here, e.g. status, pathIndex, etc.
};

var ownerEntity = myOwnerEntity; // the Entity that owns the path
var eventComponent = new Game.Pathfind.PathUpdated(ownerEntity, pathEvent);

// Using an EntityManager (e.g. in some system)
entityManager.AddComponentData(targetEntity, eventComponent);

// Or replace existing event component:
entityManager.SetComponentData(targetEntity, eventComponent);

Notes: - This struct is a simple value type and safe to use in burst/jobified contexts as long as PathEventData is also blittable/value-type safe. - Because this is typically used as an event/transient component, systems should remove or clear the component after handling the event to avoid repeated processing.