ParameterDictionary Class

Summary

A dictionary of Animancer.IParameters registered using Animancer.StringReferences.
Assembly
Animancer.dll
Namespace
Animancer
Interfaces
Base Types
  • Object
graph BT Type-->Base0["Object"] Type-.->Interface0["IEnumerable<IParameter>"] Type["ParameterDictionary"] class Type type-node

Syntax

public class ParameterDictionary : IEnumerable<IParameter>

Properties

Name Value Summary
Count int
The number of parameters that have been registered.
Keys Dictionary<Object, IParameter>.KeyCollection
All registered keys.
Parameters Dictionary<Object, IParameter>.ValueCollection
All registered parameters.

Methods

Name Value Summary
AddOnValueChanged<T>(StringReference, Action<T>, bool) void
Adds an Animancer.Parameter`1.OnValueChanged callback to the parameter registered with the `key`. Creates the parameter if it didn't exist yet.
GetEnumerator() Dictionary<Object, IParameter>.ValueCollection.Enumerator
Returns an enumerator that iterates through all registered parameters.
GetFloat(StringReference) float
Gets the value of a float parameter registered with the `key`. Returns 0 if no such parameter exists.
GetOrCreate<T>(StringReference) Parameter<T>
Gets an existing parameter registered with the `key` or creates one if necessary.
GetValue<T>(StringReference) T
Gets the value of the parameter registered with the `key`. Returns the default value if no such parameter exists.
RemoveOnValueChanged<T>(StringReference, Action<T>) void
Removes an Animancer.Parameter`1.OnValueChanged callback to the parameter registered with the `key`.
SetValue<T>(StringReference, T) void
Sets the `value` of the parameter registered with the `key`. Creates the parameter if it didn't exist yet.
TryGet(StringReference, IParameter) bool
Tries to get a `parameter` registered with the `key`.
TryGet<T>(StringReference, Parameter<T>) bool
Tries to get a `parameter` registered with the `key` and verifies its type.