mirror of
https://github.com/NotAKidoS/NAK_CVR_Mods.git
synced 2025-09-02 22:39:22 +00:00
VisualCloneFix: Fixed FPRExclusion support
This commit is contained in:
parent
c8c9dd89aa
commit
9e3edf9241
3 changed files with 20 additions and 6 deletions
|
@ -26,9 +26,14 @@ public static class Patches
|
|||
ref Dictionary<Transform, FPRExclusion> __result)
|
||||
{
|
||||
// add an fpr exclusion to the head bone
|
||||
FPRExclusion headExclusion = headBone.gameObject.AddComponent<FPRExclusion>();
|
||||
if (!headBone.TryGetComponent(out FPRExclusion headExclusion))
|
||||
{
|
||||
headExclusion = headBone.gameObject.AddComponent<FPRExclusion>();
|
||||
headExclusion.isShown = false; // default to hidden
|
||||
headExclusion.target = headBone;
|
||||
}
|
||||
|
||||
MeshHiderExclusion headExclusionBehaviour = new();
|
||||
headExclusion.target = headBone;
|
||||
headExclusion.behaviour = headExclusionBehaviour;
|
||||
headExclusionBehaviour.id = 1; // head bone is always 1
|
||||
|
||||
|
@ -128,4 +133,13 @@ public static class Patches
|
|||
__result = vertexIndices;
|
||||
return false;
|
||||
}
|
||||
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(MeshHiderExclusion), nameof(MeshHiderExclusion.UpdateExclusions))]
|
||||
private static bool OnUpdateExclusions(bool isShown, bool shrinkToZero, ref int ___id)
|
||||
{
|
||||
if (isShown) LocalCloneManager.cullingMask &= ~(1 << ___id);
|
||||
else LocalCloneManager.cullingMask |= 1 << ___id;
|
||||
return false;
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue