SmoothedFloatParameter Class

Summary

A wrapper around a Animancer.Parameter`1 containing a float which uses UnityEngine.Mathf.SmoothDamp(System.Single,System.Single,System.Single@,System.Single,System.Single,System.Single) to smoothly update its value.
Assembly
Animancer.dll
Namespace
Animancer
Interfaces
Base Types
graph BT Type-->Base0["Updatable"] click Base0 "/animancer/api/Animancer/Updatable" Base0-->Base1["Object"] Type-.->Interface0["IUpdatable"] click Interface0 "/animancer/api/Animancer/IUpdatable" Type-.->Interface1["IDisposable"] Type["SmoothedFloatParameter"] class Type type-node

Syntax

public class SmoothedFloatParameter : Updatable, IUpdatable, IDisposable

Remarks

Sample: Directional Mixers (uses Animancer.SmoothedVector2Parameter which is similar).

Example:
[SerializeField] private AnimancerComponent _Animancer;
[SerializeField] private StringAsset _Parameter;
[SerializeField, Seconds] private float _ParameterSmoothTime;

private SmoothedFloatParameter _SmoothedParameter;

protected virtual void Awake()
{
    _SmoothedParameter = new SmoothedFloatParameter(
        _Animancer,
        _Parameter,
        _ParameterSmoothTime);
}

protected virtual void Update()
{
    _SmoothedParameter.TargetValue = ...;
}

protected virtual void OnDestroy()
{
    _SmoothedParameter.Dispose();
}

Constructors

Name Summary
SmoothedFloatParameter(AnimancerGraph, Parameter<float>, float, float) Creates a new Animancer.SmoothedFloatParameter.
SmoothedFloatParameter(AnimancerGraph, StringReference, float, float) Creates a new Animancer.SmoothedFloatParameter.

Fields

Name Constant Value Summary
Graph
The graph containing the Animancer.SmoothedFloatParameter.Parameter.
Parameter
The target parameter being damped.

Properties

Name Value Summary
CurrentValue float
The value that the parameter is moving towards.
MaxSpeed float
The maximum speed that the current value can move towards the target.
SmoothTime float
The amount of time allowed to smooth out a value change.
TargetValue float
The value that the parameter is moving towards.
Velocity float
The speed at which the value is currently moving.

Methods

Name Value Summary
Dispose() void
Unbinds this smoother from the Animancer.SmoothedFloatParameter.Parameter.
Update() void
Updates this object.