DontAllowFade Class

Summary

An Animancer.IUpdatable that cancels any fades and logs warnings when they occur.
Assembly
Animancer.dll
Namespace
Animancer
Interfaces
Base Types
graph BT Type-->Base0["Key"] click Base0 "/animancer/api/Animancer/Key" Base0-->Base1["Object"] Type-.->Interface0["IUpdatable"] click Interface0 "/animancer/api/Animancer/IUpdatable" Type-.->Interface1["Key.IListItem"] click Interface1 "/animancer/api/Animancer/IListItem" Type["DontAllowFade"] class Type type-node

Syntax

public class DontAllowFade : Key, IUpdatable, Key.IListItem

Examples

[SerializeField] private AnimancerComponent _Animancer;

private void Awake()
{
    // To only apply it only in the Unity Editor and Development Builds:
    DontAllowFade.Assert(_Animancer);
    
    // Or to apply it at all times:
    _Animancer.Playable.RequireUpdate(new DontAllowFade());
}

Remarks

This is useful for UnityEngine.Sprite based characters since fading does nothing for them.

You can also set the Animancer.AnimancerPlayable.DefaultFadeDuration to 0 so that you don't need to set it manually on all your transitions.

Fields

Name Constant Value Summary
NotInList -1
The Animancer.Key._Index which indicates that an item isn't in a list.
Inherited from Key
static

Methods

Name Value Summary
Assert(AnimancerPlayable) void
[Assert-Conditional] Applies a Animancer.DontAllowFade to `animancer`.
static
IndexOf(Key) int
Returns location of this object in the list (or -1 if it is not currently in a keyed list).
Inherited from Key
static
IsInList(Key) bool
Is the `key` currently in a keyed list?
Inherited from Key
static