FadeGroupExtensions.

SetEasing(FadeGroup, Easing.Function) Method

Summary

[Pro-Only] Assigns the Animancer.Easing.GetDelegate(Animancer.Easing.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, Easing.Function 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 Easing.Function

Return Value

Type Description
void