mirror of
https://github.com/hanetzer/sdraw_mods_cvr.git
synced 2025-09-04 02:49:23 +00:00
[PRM] Avatar Scaling Support
This commit is contained in:
parent
c887eacc6a
commit
699d7bdd5f
2 changed files with 36 additions and 0 deletions
|
@ -36,6 +36,11 @@ namespace ml_prm
|
|||
null,
|
||||
new HarmonyLib.HarmonyMethod(typeof(PlayerRagdollMod).GetMethod(nameof(OnSetupAvatar_Postfix), BindingFlags.Static | BindingFlags.NonPublic))
|
||||
);
|
||||
HarmonyInstance.Patch(
|
||||
typeof(PlayerSetup).GetMethod("SetupIKScaling", BindingFlags.NonPublic | BindingFlags.Instance),
|
||||
null,
|
||||
new HarmonyLib.HarmonyMethod(typeof(PlayerRagdollMod).GetMethod(nameof(OnSetupIKScaling_Postfix), BindingFlags.Static | BindingFlags.NonPublic))
|
||||
);
|
||||
HarmonyInstance.Patch(
|
||||
typeof(CVRSeat).GetMethod(nameof(CVRSeat.SitDown)),
|
||||
new HarmonyLib.HarmonyMethod(typeof(PlayerRagdollMod).GetMethod(nameof(OnCVRSeatSitDown_Prefix), BindingFlags.Static | BindingFlags.NonPublic)),
|
||||
|
@ -120,6 +125,20 @@ namespace ml_prm
|
|||
}
|
||||
}
|
||||
|
||||
static void OnSetupIKScaling_Postfix(ref UnityEngine.Vector3 ___scaleDifference) => ms_instance?.OnSetupIKScaling(___scaleDifference.y);
|
||||
void OnSetupIKScaling(float scaleDifference)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (m_localController != null)
|
||||
m_localController.OnAvatarScaling(1f + scaleDifference);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
MelonLoader.MelonLogger.Error(e);
|
||||
}
|
||||
}
|
||||
|
||||
static void OnCVRSeatSitDown_Prefix(ref CVRSeat __instance) => ms_instance?.OnCVRSeatSitDown(__instance);
|
||||
void OnCVRSeatSitDown(CVRSeat p_seat)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue