mirror of
https://github.com/hanetzer/sdraw_mods_cvr.git
synced 2025-09-03 18:39:23 +00:00
Animator state check
This commit is contained in:
parent
28aca1bb49
commit
1dad5d6415
1 changed files with 8 additions and 5 deletions
|
@ -256,13 +256,15 @@ namespace ml_amt
|
|||
return false;
|
||||
}
|
||||
|
||||
static void OnOverride_Prefix(ref CVRAnimatorManager __instance)
|
||||
static void OnOverride_Prefix(ref CVRAnimatorManager __instance, ref bool __state)
|
||||
{
|
||||
try
|
||||
{
|
||||
if(Settings.OverrideFix && (__instance.animator != null))
|
||||
{
|
||||
__instance.animator.enabled = false;
|
||||
__state = __instance.animator.enabled;
|
||||
if(__state)
|
||||
__instance.animator.enabled = false;
|
||||
__instance.animator.WriteDefaultValues();
|
||||
}
|
||||
}
|
||||
|
@ -271,14 +273,15 @@ namespace ml_amt
|
|||
MelonLoader.MelonLogger.Error(l_exception);
|
||||
}
|
||||
}
|
||||
static void OnOverride_Postfix(ref CVRAnimatorManager __instance)
|
||||
static void OnOverride_Postfix(ref CVRAnimatorManager __instance, bool __state)
|
||||
{
|
||||
try
|
||||
{
|
||||
if(Settings.OverrideFix && (__instance.animator != null))
|
||||
{
|
||||
__instance.animator.enabled = true;
|
||||
__instance.animator.Update(0f);
|
||||
__instance.animator.enabled = __state;
|
||||
if(__state)
|
||||
__instance.animator.Update(0f);
|
||||
}
|
||||
}
|
||||
catch(System.Exception l_exception)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue