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
-
- IUpdatable
- IDisposable
- Base Types
-
- Object
- Updatable
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 |
---|---|
Smoothed |
Creates a new Animancer.SmoothedFloatParameter . |
Smoothed |
Creates a new Animancer.SmoothedFloatParameter . |
Fields
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.
|