mirror of
https://github.com/NotAKidoS/NAK_CVR_Mods.git
synced 2025-09-03 14:59:23 +00:00
[BadAnimatorFix] Speculative fix for loading Login, Init, and HQ scenes.
Exterrata said it kept erroring but I could not reproduce. This should solve it.
This commit is contained in:
parent
13927f1d67
commit
a902cd250f
6 changed files with 49 additions and 50 deletions
|
@ -9,18 +9,17 @@ public class BadAnimatorFixer : MonoBehaviour
|
|||
|
||||
private Animator animator;
|
||||
|
||||
private void Start()
|
||||
void Start()
|
||||
{
|
||||
animator = GetComponent<Animator>();
|
||||
}
|
||||
|
||||
private void OnEnable() => BadAnimatorFixManager.Add(this);
|
||||
private void OnDisable() => BadAnimatorFixManager.Remove(this);
|
||||
void OnEnable() => BadAnimatorFixManager.Add(this);
|
||||
void OnDisable() => BadAnimatorFixManager.Remove(this);
|
||||
|
||||
public void AttemptRewindAnimator()
|
||||
{
|
||||
bool rewound = false;
|
||||
|
||||
if (animator != null && animator.isActiveAndEnabled)
|
||||
{
|
||||
for (int layerIndex = 0; layerIndex < animator.layerCount; layerIndex++)
|
||||
|
@ -38,9 +37,7 @@ public class BadAnimatorFixer : MonoBehaviour
|
|||
}
|
||||
|
||||
if (rewound)
|
||||
{
|
||||
PlayableExtensions.SetTime<Playable>(animator.playableGraph.GetRootPlayable(0), 0);
|
||||
}
|
||||
}
|
||||
|
||||
if (BadAnimatorFix.EntryLogging.Value)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue