HookEvent
Host-dispatchable hook fired by an authored Hook event. Name is the
hook id the writer chose; Params are the named arguments. Pattern-match
on Name and read Params (or use ParamsAs<T>() for typed access).
public class HookEvent : EventBase
Inheritance System.Object → EventBase → HookEvent
Properties
Name
Author-defined hook name. Switch on this to dispatch to the right handler.
public string Name { get; }
Property Value
Params
Named arguments captured at the firing site. Null when the hook took no args.
public IReadOnlyDictionary<string,object>? Params { get; }
Property Value
System.Collections.Generic.IReadOnlyDictionary<System.String,System.Object>
Methods
Accept(IEventQueueVisitor)
Dispatches to Visit(HookEvent).
public override void Accept(IEventQueueVisitor visitor);
Parameters
visitor IEventQueueVisitor
Visitor to dispatch this event to.
ParamsAs<T>()
Convenience accessor — copy Params into a new T by matching property names (case-insensitive, also accepts snake_case). Reflection-based; Unity-safe but skipped by trimmed WASM builds (IL2090 suppressed at the Wasm project level).
public T ParamsAs<T>()
where T : new();
Type parameters
T
Host-defined POCO whose properties name the params to extract. Must have a parameterless constructor.
Returns
T
A new T with matching properties populated from Params. Unmatched properties keep their default values; unconvertible values are silently skipped. Returns an empty T when Params is null.
Inherited Properties
| Member | Source |
|---|---|
At | inherited from EventBase |
Timing | inherited from EventBase |