-
-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
61 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
using CullFactory.Data; | ||
using HarmonyLib; | ||
using LCVR.Patches; | ||
using LCVR.Player; | ||
using UnityEngine; | ||
|
||
namespace LCVR.Compatibility.CullFactory; | ||
|
||
[LCVRPatch(dependency: "CullFactory")] | ||
[HarmonyPatch] | ||
internal static class Patches | ||
{ | ||
/// <summary> | ||
/// Fix for CullFactory to include the VR helmet lights in the <see cref="DynamicObjects.allPlayerLights"/> array | ||
/// </summary> | ||
[HarmonyPatch(typeof(DynamicObjects), nameof(DynamicObjects.CollectAllPlayerLights))] | ||
[HarmonyPostfix] | ||
private static void OnCollectAllPlayerLights() | ||
{ | ||
if (!VRSession.Instance) | ||
return; | ||
|
||
var clientId = VRSession.Instance.LocalPlayer.PlayerController.playerClientId; | ||
var lights = DynamicObjects.allPlayerLights[clientId]; | ||
var cameraLights = VRSession.Instance.MainCamera.GetComponentsInChildren<Light>(); | ||
|
||
DynamicObjects.allPlayerLights[clientId] = [..lights, ..cameraLights]; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters