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
ActionThe executed entity change: Remove, Add or Remove component.
EntityIdThe Id of the Entity that emitted the event.
StoreThe EntityStore containing the Entity that emitted the event.
StructIndex
Properties
ComponentTypeThe ComponentType of the added / removed component.
DebugComponentReturn the current IComponent for debugging.
Note: It degrades performance as it boxes the returned component.
DebugOldComponentReturn the old IComponent for debugging.
Note: It degrades performance as it boxes the returned component.
EntityThe Entity that emitted the event - aka the publisher.
TypeThe 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()