ComponentChanged.md
February 25, 2024 ยท View on GitHub
Friflo.Engine.ECS
Friflo.Engine.ECS
ComponentChanged Struct
Is the event for event handlers added to OnComponentChanged, OnComponentAdded or OnComponentRemoved.
public readonly struct ComponentChanged
Remarks
These events are fired on:
| Fields | |
|---|---|
| Action | The executed entity change: Remove, Add or Remove component. |
| EntityId | The Id of the Entity that emitted the event. |
| Store | The EntityStore containing the Entity that emitted the event. |
| StructIndex |
| Properties | |
|---|---|
| ComponentType | The ComponentType of the added / removed component. |
| DebugComponent | Return the current IComponent for debugging. Note: It degrades performance as it boxes the returned component. |
| DebugOldComponent | Return the old IComponent for debugging. Note: It degrades performance as it boxes the returned component. |
| Entity | The Entity that emitted the event - aka the publisher. |
| Type | The System.Type of the added / removed component. |
| Methods | |
|---|---|
| Component<T>() | Returns the current component value after executing the Add or Update component. |
| OldComponent<T>() | Returns the old component value before executing Update or Remove component. Note: See Remarks for restrictions. |
| ToString() |