using Invector; using UnityEngine; public class vChangeAnimatorUpdateMode : MonoBehaviour { public Animator animator; private readonly AnimatorUpdateMode initialState = AnimatorUpdateMode.Fixed; public void Reset() { animator = GetComponentInParent(); } private void Start() { if (!animator) animator = GetComponentInParent(); } public void ChangeToUnscaledTime() { if (Time.timeScale == 0) { vTime.useUnscaledTime = true; animator.updateMode = AnimatorUpdateMode.UnscaledTime; } } public void ChangeToAnimatePhysics() { animator.updateMode = AnimatorUpdateMode.Fixed; vTime.useUnscaledTime = false; } public void ChangeToInitialState() { animator.updateMode = initialState; vTime.useUnscaledTime =initialState== AnimatorUpdateMode.UnscaledTime ?true:false; } }