mirror of
https://github.com/NotAKidoS/NAK_CVR_Mods.git
synced 2025-09-02 14:29:25 +00:00
Added PlantFeet & EnforceViewPosition Settings.
This commit is contained in:
parent
55a3009f96
commit
65896d5f14
3 changed files with 48 additions and 3 deletions
|
@ -3,6 +3,8 @@ using ABI_RC.Core.Player;
|
|||
using ABI_RC.Core.Savior;
|
||||
using ABI_RC.Systems.IK;
|
||||
using ABI_RC.Systems.IK.SubSystems;
|
||||
using ABI_RC.Systems.MovementSystem;
|
||||
using ABI_RC.Core.Player.AvatarTracking.Local;
|
||||
using HarmonyLib;
|
||||
using RootMotion.FinalIK;
|
||||
using UnityEngine;
|
||||
|
@ -88,4 +90,21 @@ internal class HarmonyPatches
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
[HarmonyPostfix]
|
||||
[HarmonyPatch(typeof(PlayerSetup), "HandleDesktopCameraPosition")]
|
||||
private static void Postfix_PlayerSetup_HandleDesktopCameraPosition(bool ignore, ref PlayerSetup __instance, ref MovementSystem ____movementSystem, ref int ___headBobbingLevel)
|
||||
{
|
||||
if (DesktopVRIK.Instance.Setting_EnforceViewPosition)
|
||||
{
|
||||
if (!____movementSystem.disableCameraControl || ignore)
|
||||
{
|
||||
if (___headBobbingLevel == 2 && DesktopVRIK.Instance.viewpoint != null)
|
||||
{
|
||||
__instance.desktopCamera.transform.localPosition = Vector3.zero;
|
||||
__instance.desktopCameraRig.transform.position = DesktopVRIK.Instance.viewpoint.position;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue