Entity.AddSignalHandler_TEvent_(Action_Signal_TEvent__).md

July 25, 2024 ยท View on GitHub

Friflo.Engine.ECS

Friflo.Engine.ECS.Entity

Entity.AddSignalHandler(Action<Signal>) Method

Add the given Signal<TEvent> handler to the entity.
See Example.

public System.Action<Friflo.Engine.ECS.Signal<TEvent>> AddSignalHandler<TEvent>(System.Action<Friflo.Engine.ECS.Signal<TEvent>> handler)
    where TEvent : struct, System.ValueType, System.ValueType;

Type parameters

TEvent

Parameters

handler System.Action<Friflo.Engine.ECS.Signal<TEvent>>

Returns

System.Action<Friflo.Engine.ECS.Signal<TEvent>>
The the signal handler added to the entity.
Practical when passing a lambda that can be removed later with RemoveSignalHandler<TEvent>(Action<Signal<TEvent>>).