25 lines
752 B
C#
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;
|
|
}
|
|
}
|
|
} |