NamedEventDictionary.

AddTo<T>(StringReference, Action<T>) Method

Summary

Adds the `callback` to any existing ones registered with the `name`.

It will be invoked using Animancer.AnimancerEvent.GetCurrentParameter``1 to get its parameter.
Assembly
Animancer.dll
Namespace
Animancer
Containing Type
NamedEventDictionary

Syntax

public Action AddTo<T>(StringReference name, Action<T> callback)

Remarks

If you want an exception to be thrown if something is already registered with the `name`, use Animancer.NamedEventDictionary.AddNew``1(Animancer.StringReference,System.Action{``0}) instead.

If T is string, consider using Animancer.NamedEventDictionary.AddTo(Animancer.StringReference,System.Action{System.String}) instead of this overload.

If you want to later remove the `callback`, you need to store and remove the returned System.Action.

Type Parameters

Name Description
T

Parameters

Name Type Description
name StringReference
callback Action<T>

Return Value

Type Description
Action