Summary
Registers the `callback` with the `name` but throws an
System.ArgumentException
if something was already registered with the same `name`.
It will be invoked using System.Object.ToString on the
Animancer.AnimancerEvent.CurrentParameter.
- Assembly
- Animancer
.dll - Namespace
- Animancer
- Containing Type
- NamedEventDictionary
Syntax
public Action AddNew(StringReference name, Action<string> callback)
Remarks
This matches the standard
System.Collections.Generic.Dictionary`2.Add(`0,`1)
behaviour, unlike Animancer.NamedEventDictionary.AddTo(Animancer.StringReference,System.Action{System.String}).
If you want to later remove the `callback`,
you need to store and remove the returned System.Action.
Parameters
| Name | Type | Description |
|---|---|---|
| name | StringReference | |
| callback | Action |
Return Value
| Type | Description |
|---|---|
| Action |