Summary
[Pro-Only]
A system which fades animation weights animations using a custom calculation rather than linear interpolation.
- Assembly
- Animancer
.dll - Namespace
- Animancer
- Interfaces
- Base Types
-
- Object
- Key
graph BT
Type-->Base0["Key"]
click Base0 "/animancer-v7-4/api/Animancer/Key"
Base0-->Base1["Object"]
Type-.->Interface0["IUpdatable"]
click Interface0 "/animancer-v7-4/api/Animancer/IUpdatable"
Type-.->Interface1["Key.IListItem"]
click Interface1 "/animancer-v7-4/api/Animancer/IListItem"
Type["CustomFade"]
class Type type-node
Syntax
public abstract class CustomFade : Key, IUpdatable, Key.IListItem
Examples
[SerializeField] private AnimancerComponent _Animancer;
[SerializeField] private AnimationClip _Clip;
private void Awake()
{
// Start fading the animation normally.
var state = _Animancer.Play(_Clip, 0.25f);
// Then apply the custom fade to modify it.
CustomFade.Apply(state, Easing.Sine.InOut);// Use a delegate.
CustomFade.Apply(state, Easing.Function.SineInOut);// Or use the Function enum.
// Or apply it to whatever the current state happens to be.
CustomFade.Apply(_Animancer, Easing.Sine.InOut);
// Anything else you play after that will automatically cancel the custom fade.
}
Remarks
Documentation: Custom Fade
Fields
Methods
Name | Value | Summary |
---|---|---|
Apply |
void |
Modify the current fade to use the specified `curve` to calculate the weight.
static
|
Apply |
void |
Modify the current fade to use the specified `function` to calculate the weight.
static
|
Apply |
void |
Modify the current fade to use the specified `calculateWeight` delegate.
static
|
Apply |
void |
Gathers the current details of the
Animancer.AnimancerNode.Root and register this
Animancer.CustomFade to be updated by it so that it can replace the regular fade behaviour.
|
Apply |
void |
Modify the current fade to use the specified `curve` to calculate the weight.
static
|
Apply |
void |
Modify the current fade to use the specified `function` to calculate the weight.
static
|
Apply |
void |
Modify the current fade to use the specified `calculateWeight` delegate.
static
|
Apply |
void |
Modify the current fade to use the specified `curve` to calculate the weight.
static
|
Apply |
void |
Modify the current fade to use the specified `function` to calculate the weight.
static
|
Apply |
void |
Modify the current fade to use the specified `calculateWeight` delegate.
static
|
Apply |
void |
Gathers the current details of the
Animancer.AnimancerNode.Root and register this
Animancer.CustomFade to be updated by it so that it can replace the regular fade behaviour.
|
Apply |
void |
Modify the current fade to use the specified `curve` to calculate the weight.
static
|
Apply |
void |
Modify the current fade to use the specified `function` to calculate the weight.
static
|
Apply |
void |
Modify the current fade to use the specified `calculateWeight` delegate.
static
|
CalculateWeight |
float |
Returns the desired weight for the target state at the specified `progress` (ranging from 0 to 1).
|
IndexOf |
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 |
bool |
Is the `key` currently in a keyed list?
Inherited from Key
static
|
Release |
void |
Called when this fade is cancelled (or ends).
|