Summary
Demonstrates how to use a
Animancer.NamedAnimancerComponent to play animations by name.
- Assembly
- Animancer
.dll - Namespace
- Animancer
.Examples .FineControl - Base Types
-
- MonoBehaviour
graph BT
Type-->Base0["MonoBehaviour"]
Type["NamedAnimations"]
class Type type-node
Syntax
[AddComponentMenu(Strings.ExamplesMenuPrefix + "Fine Control - Named Animations")]
[HelpURL(Strings.DocsURLs.ExampleAPIDocumentation + nameof(FineControl) + "/" + nameof(NamedAnimations))]
public sealed class NamedAnimations : MonoBehaviour
Examples
Attributes
| Type | Description |
|---|---|
| AddComponentMenu | |
| HelpURLAttribute |
Methods
| Name | Value | Summary |
|---|---|---|
| InitializeWalkState |
void |
Creates a state for the walk animation so that
Animancer.Examples.FineControl.NamedAnimations.PlayWalk can play it.
|
| PlayIdle |
void |
Plays the idle animation by name. This requires the animation to already have a state in the
Animancer.NamedAnimancerComponent, which has already been done in this example by adding it to the
Animancer.NamedAnimancerComponent.Animations list in the Inspector.
If it has not been added, this method will simply do nothing.
|
| PlayRun |
void |
Plays the run animation using a direct reference to show that the ability to play animations by
name in a
Animancer.NamedAnimancerComponent does not prevent it from also using direct references like
the base Animancer.AnimancerComponent.
|
| PlayWalk |
void |
Plays the walk animation by name. Unlike the idle animation, this one has not been added to the
Inspector list so it will not exist and this method will log a warning unless you call
Animancer.Examples.FineControl.NamedAnimations.InitializeWalkState first.
|