Files
Hasebe/Assets/Code/Infrastructure/Utils/AnimatorUtil.cs
T
2026-11-02 01:46:10 +03:00

25 lines
752 B
C#

using Code.OfficeGame.BattleMode.Actions;
using UnityEngine;
namespace Code.Infrastructure.Utils
{
public static class AnimatorSnapshotExtensions
{
public static AnimatorSnapshot GetSnapshot(this Animator animator)
{
return AnimatorSnapshot.GetSnapshot(animator);
}
public static void RestoreSnapshot(this Animator animator, AnimatorSnapshot snapshot)
{
snapshot.RestoreTo(animator);
}
public static void ResetAnimatorPosition(this Animator animator)
{
animator.applyRootMotion = false;
animator.transform.localPosition = Vector3.zero;
animator.transform.localRotation = Quaternion.identity;
}
}
}