37 lines
1.4 KiB
C#
37 lines
1.4 KiB
C#
![]() |
// Animancer // https://kybernetik.com.au/animancer // Copyright 2018-2024 Kybernetik //
|
||
|
|
||
|
#pragma warning disable CS0649 // Field is never assigned to, and will always have its default value.
|
||
|
|
||
|
using UnityEngine;
|
||
|
|
||
|
namespace Animancer.Samples.StateMachines
|
||
|
{
|
||
|
/// <summary>A <see cref="CharacterState"/> which plays an animation.</summary>
|
||
|
///
|
||
|
/// <remarks>
|
||
|
/// <strong>Sample:</strong>
|
||
|
/// <see href="https://kybernetik.com.au/animancer/docs/samples/fsm/characters">
|
||
|
/// Characters</see>
|
||
|
/// </remarks>
|
||
|
///
|
||
|
/// https://kybernetik.com.au/animancer/api/Animancer.Samples.StateMachines/IdleState
|
||
|
///
|
||
|
[AddComponentMenu(Strings.SamplesMenuPrefix + "Characters - Idle State")]
|
||
|
[AnimancerHelpUrl(typeof(IdleState))]
|
||
|
public class IdleState : CharacterState
|
||
|
{
|
||
|
/************************************************************************************************************************/
|
||
|
|
||
|
[SerializeField] private TransitionAsset _Animation;
|
||
|
|
||
|
/************************************************************************************************************************/
|
||
|
|
||
|
protected virtual void OnEnable()
|
||
|
{
|
||
|
Character.Animancer.Play(_Animation);
|
||
|
}
|
||
|
|
||
|
/************************************************************************************************************************/
|
||
|
}
|
||
|
}
|