Game.Triggers.LifePathEventCreationData
Assembly: (unspecified)
Namespace: Game.Triggers
Type: struct
Base: System.ValueType
Summary:
Represents a small POD (plain-old-data) container used to describe and pass data required to create a "life path" event in the game's trigger system. Holds the trigger type, the event prefab to instantiate, and references to involved entities (sender/target/original sender). This struct is intended to be used with Unity.Entities (ECS) code that creates or queues in-game events.
Fields
-
public TriggerType m_TriggerType
Type of trigger that caused this life-path event (likely an enum defined elsewhere in Game.Triggers). Use this to distinguish event behavior based on trigger kind. -
public Entity m_EventPrefab
Entity reference to the event prefab to instantiate. This is a Unity.Entities.Entity that represents the prefab archetype to spawn for the event. -
public Entity m_Sender
Entity that is considered the sender of the event (the immediate source in the current context). -
public Entity m_Target
Entity that is the target of the event (the intended recipient or subject). -
public Entity m_OriginalSender
Entity that originally initiated the action, if different from m_Sender (useful when events are forwarded or proxied).
Properties
- This struct has no properties; it exposes plain public fields for simple value semantics.
Constructors
public LifePathEventCreationData()
Default value-type constructor (provided implicitly for structs). Typical usage is to construct with an object initializer to set the fields.
Methods
- This struct declares no methods. It is a simple data container.
Usage Example
using Unity.Entities;
using Game.Triggers;
void QueueLifePathEvent(Entity eventPrefab, Entity sender, Entity target, Entity originalSender, TriggerType triggerType)
{
var creationData = new LifePathEventCreationData
{
m_TriggerType = triggerType,
m_EventPrefab = eventPrefab,
m_Sender = sender,
m_Target = target,
m_OriginalSender = originalSender
};
// Example: pass creationData into whatever system/function handles life-path event creation
// TriggerEventSystem.EnqueueLifePathEvent(creationData);
}
{{ Notes: - All Entity fields are Unity.Entities.Entity (ECS). Ensure the referenced entities/prefabs are valid in the current EntityManager/world before using them. - TriggerType must be defined elsewhere (likely an enum). Match its values to the event handling logic. - Because this is a struct, it is copied by value; modify a local copy when needed. }}