// Animancer // https://kybernetik.com.au/animancer // Copyright 2018-2023 Kybernetik //
using Animancer.Examples.StateMachines;
using UnityEngine;
namespace Animancer.Examples.AnimatorControllers
{
/// A which plays an animation.
///
///
/// This class is very similar to , except that it plays the animation inside an Animator
/// Controller instead of as a Transition.
///
///
/// Hybrid Character
///
/// https://kybernetik.com.au/animancer/api/Animancer.Examples.AnimatorControllers/HybridIdleState
///
[AddComponentMenu(Strings.ExamplesMenuPrefix + "Hybrid - Idle State")]
[HelpURL(Strings.DocsURLs.ExampleAPIDocumentation + nameof(AnimatorControllers) + "/" + nameof(HybridIdleState))]
public sealed class HybridIdleState : CharacterState
{
/************************************************************************************************************************/
///
/// Normally the class would have a reference to the specific type of
/// we want, but for the sake of reusing code from the earlier example, we
/// just use a type cast here.
///
private HybridAnimancerComponent HybridAnimancer
=> (HybridAnimancerComponent)Character.Animancer;
/************************************************************************************************************************/
private void OnEnable()
{
HybridAnimancer.PlayController();
HybridAnimancer.SetBool(Animations.IsMoving, false);
}
/************************************************************************************************************************/
}
}