AnimancerPlayable.

DefaultFadeDuration Property

Summary

The fade duration to use if not specified. Default is 0.25.
Assembly
Animancer.dll
Namespace
Animancer
Containing Type
AnimancerPlayable

Syntax

public static float DefaultFadeDuration { get; set; }

Examples

UnityEngine.Sprite based games often have no use for fading so you could set this value to 0 using the following script so that you don't need to manually set the Animancer.ITransition.FadeDuration of all your transitions.

To set this value automatically on startup, put the following class into any script:

namespace Animancer
{
    internal static class DefaultFadeDuration
    {
        [UnityEngine.RuntimeInitializeOnLoadMethod(UnityEngine.RuntimeInitializeLoadType.BeforeSceneLoad)]
        private static void Initialize() => AnimancerPlayable.DefaultFadeDuration = 0;
    }
}
Using that specific namespace (Animancer.AnimancerPlayable.DefaultFadeDurationNamespace) and class name (Animancer.AnimancerPlayable.DefaultFadeDurationClass) allows Animancer to find and run it immediately in the Unity Editor so that newly created transition fields can start with the correct value (using a [UnityEditor.InitializeOnLoadMethod] attribute would run it too late).

Remarks

Animancer Lite doesn't allow this value to be changed in runtime builds (except to 0).

Value

Type Description
float