πΈSimple Animation Player
This page explains how Simple Animation Player works.
Last updated
This page explains how Simple Animation Player works.
Last updated
public bool PlayAnimation(AnimationAsset newAnimation, float startTime = 0f).[SerializedField] private AnimationClip weaponIdlePose;
private SimpleAnimationPlayer _animationPlayer;
private void Start()
{
// 1. Try to get the animation player.
_animationPlayer = GetComponent<SimpleAnimationPlayer>();
// 2. Play weapon base pose
if(_animationPlayer != null) _animationPlayer.PlayBasePlayable(weaponIdlePose);
}
private void PlayReloadAnimation(AnimationAsset reloadAnimation)
{
// 3. Play custom animations on demand.
if(_animationPlayer != null) _animationPlayer.PlayAnimation(reloadAnimation);
}