Game.Prefabs.LifePathEventData
Assembly: Assembly-CSharp
Namespace: Game.Prefabs
Type: struct
Base: IComponentData, IQueryTypeParameter
Summary:
Component data used to represent a life‑path related event in the game's ECS. Holds an archetype for a "chirp" entity (if the event spawns one), an enum describing the concrete event type, and a boolean flag indicating whether this event is a chirp. Implementing IComponentData makes it usable as a component on entities; implementing IQueryTypeParameter indicates it can be used as a query parameter in DOTS-style queries/systems.
Fields
-
public EntityArchetype m_ChirpArchetype
Archetype to use when spawning a chirp entity associated with this life‑path event. May be default/uninitialized if the event does not spawn an entity. -
public LifePathEventType m_EventType
Enum value describing which kind of life‑path event this component represents. Refer to the LifePathEventType enum for possible values (not included in this file). -
public bool m_IsChirp
Flag indicating whether the event is a "chirp" (short notification/spawned entity) or a different type of life‑path event.
Properties
- This struct has no properties.
Constructors
public LifePathEventData()
Default parameterless constructor provided by C#. Fields will have default values (m_ChirpArchetype = default, m_EventType = default, m_IsChirp = false). You can initialize fields with an object initializer when creating an instance.
Methods
- This struct defines no methods.
Usage Example
// Example: creating and attaching a LifePathEventData component to a new entity
var em = World.DefaultGameObjectInjectionWorld.EntityManager;
// Create or obtain an EntityArchetype for the chirp entity (example only; actual types vary)
var chirpArchetype = em.CreateArchetype(typeof(Translation), typeof(RenderMesh));
// Construct the component
var lifeEvent = new LifePathEventData {
m_ChirpArchetype = chirpArchetype,
m_EventType = LifePathEventType.SomeEvent, // replace with an actual enum value
m_IsChirp = true
};
// Create an entity and add the component
var entity = em.CreateEntity();
em.AddComponentData(entity, lifeEvent);
Notes: - Ensure LifePathEventType is defined and accessible from your mod. - EntityArchetype values should be created with the set of component types that the chirp entity needs. - Because this is an IComponentData (DOTS ECS), use EntityManager or EntityCommandBuffer within systems to create/update entities with this component.