mirror of
https://github.com/NotAKidoS/NAK_CVR_Mods.git
synced 2025-09-02 14:29:25 +00:00
last minute refactor
This commit is contained in:
parent
407af39155
commit
50c5016cc6
7 changed files with 513 additions and 0 deletions
35
DesktopVRIK/HarmonyPatches.cs
Normal file
35
DesktopVRIK/HarmonyPatches.cs
Normal file
|
@ -0,0 +1,35 @@
|
|||
using ABI_RC.Core.Player;
|
||||
using ABI.CCK.Components;
|
||||
using ABI_RC.Core.Savior;
|
||||
using ABI_RC.Systems.IK;
|
||||
using ABI_RC.Systems.IK.SubSystems;
|
||||
using HarmonyLib;
|
||||
using MelonLoader;
|
||||
using RootMotion.FinalIK;
|
||||
|
||||
namespace DesktopVRIK;
|
||||
|
||||
[HarmonyPatch]
|
||||
internal class HarmonyPatches
|
||||
{
|
||||
[HarmonyPostfix]
|
||||
[HarmonyPatch(typeof(PlayerSetup), "SetupAvatarGeneral")]
|
||||
private static void InitializeDesktopIKSystem(ref CVRAvatar ____avatarDescriptor)
|
||||
{
|
||||
if (MetaPort.Instance.isUsingVr) return;
|
||||
|
||||
//this will stop at the useless isVr return (the function is only ever called by vr anyways...)
|
||||
IKSystem.Instance.InitializeAvatar(____avatarDescriptor);
|
||||
}
|
||||
|
||||
[HarmonyPostfix]
|
||||
[HarmonyPatch(typeof(IKSystem), "InitializeAvatar")]
|
||||
private static void InitializeDesktopAvatar(CVRAvatar avatar, ref VRIK ____vrik)
|
||||
{
|
||||
//need IKSystem to see VRIK component for setup
|
||||
____vrik = avatar.gameObject.AddComponent<VRIK>();
|
||||
//now i add my own VRIK stuff
|
||||
NAKDesktopVRIK NAKVRIK = avatar.gameObject.AddComponent<NAKDesktopVRIK>();
|
||||
NAKVRIK.CalibrateAvatarVRIK(avatar);
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue