Skip to content

Commit

Permalink
Fixed missing fog. Closes #13
Browse files Browse the repository at this point in the history
  • Loading branch information
Raicuparta committed Jan 29, 2022
1 parent b3f7297 commit 268db32
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions TwoForksVr/src/VrCamera/Patches/GameCameraPatches.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,23 @@ private static void RecenterCamera()
isDone = true;
}

[HarmonyPatch(typeof(vgCameraController), nameof(vgCameraController.Start))]
[HarmonyPrefix]
private static void ResetIsDoneOnCameraStart()
[HarmonyPatch(typeof(vgCameraController), nameof(vgCameraController.Start))]
private static void ResetIsDoneOnCameraStart(vgCameraController __instance)
{
isDone = false;
}

[HarmonyPostfix]
[HarmonyPatch(typeof(vgPlayerNavigationController), nameof(vgPlayerNavigationController.Start))]
private static void FixFog(vgPlayerNavigationController __instance)
{
var stylisticFog = __instance.cameraController.camera.GetComponent<vgStylisticFog>();
if (!stylisticFog || !stylisticFog.enabled) return;
stylisticFog.enabled = false;
stylisticFog.enabled = true;
}

[HarmonyPrefix]
[HarmonyPatch(typeof(vgLoadingCamera), nameof(vgLoadingCamera.OnEnable))]
private static void ResetIsDoneOnLoading(vgLoadingCamera __instance)
Expand Down

0 comments on commit 268db32

Please sign in to comment.