SmoothedVector2Parameter Class

Summary

Manages two Animancer.SmoothedFloatParameters as a UnityEngine.Vector2.
Assembly
Animancer.dll
Namespace
Animancer
Interfaces
  • IDisposable
Base Types
  • Object
graph BT Type-->Base0["Object"] Type-.->Interface0["IDisposable"] Type["SmoothedVector2Parameter"] class Type type-node

Syntax

public class SmoothedVector2Parameter : IDisposable

Remarks

Sample: Directional Mixers

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

private SmoothedVector2Parameter _SmoothedParameters;

protected virtual void Awake()
{
    _SmoothedParameters = new SmoothedVector2Parameter(
        _Animancer,
        _ParameterX,
        _ParameterY,
        _ParameterSmoothTime);
}

protected virtual void Update()
{
    _SmoothedParameters.TargetValue = new Vector2(...);
}

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

Constructors

Name Summary
SmoothedVector2Parameter(AnimancerGraph, StringReference, StringReference, float, float) Creates a new Animancer.SmoothedVector2Parameter.
SmoothedVector2Parameter(SmoothedFloatParameter, SmoothedFloatParameter) Creates a new Animancer.SmoothedVector2Parameter.

Fields

Name Constant Value Summary
X
The UnityEngine.Vector2.x parameter.
Y
The UnityEngine.Vector2.y parameter.

Properties

Name Value Summary
CurrentValue Vector2
The value that the parameters are 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 Vector2
The value that the parameters are moving towards.
Velocity Vector2
The speed at which the parameters are currently moving.

Methods

Name Value Summary
Dispose() void
Disposes the Animancer.SmoothedVector2Parameter.X and Animancer.SmoothedVector2Parameter.Y.