FadeGroupExtensions.

SetEasing(FadeGroup, Func<float, float>) Method

Summary

[Pro-Only] Assigns the `function` as the Animancer.FadeGroup.Easing if the `fade` isn't null.
Assembly
Animancer.dll
Namespace
Animancer
Containing Type
FadeGroupExtensions

Syntax

public static void SetEasing(this FadeGroup fade, Func<float, float> function)

Remarks

Animancer Lite ignores this feature in runtime builds.

Example:
void EasingExample(AnimancerComponent animancer, AnimationClip clip)
{
    // Start fading the animation normally.
    AnimancerState state = animancer.Play(clip, 0.25f);
    
    // Then a custom Easing delegate to modify it.
    state.FadeGroup.SetEasing(t => t * t);// Square the 0-1 value to start slow and end fast.
    
    // The Easing class has lots of standard mathematical curve functions.
    state.FadeGroup.SetEasing(Easing.Sine.InOut);
    
    // Or you can use the Easing.Function enum.
    state.FadeGroup.SetEasing(Easing.Function.SineInOut);
}

Parameters

Name Type Description
fade FadeGroup
function Func<float, float>

Return Value

Type Description
void