-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(coop): sync player rotation with headset (#129)
- Loading branch information
Showing
2 changed files
with
27 additions
and
14 deletions.
There are no files selected for viewing
27 changes: 27 additions & 0 deletions
27
plugin/src/camera/patch/PlayerFirstPersonControllerPatch.cs
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,27 @@ | ||
using HarmonyLib; | ||
using UnityEngine; | ||
|
||
namespace TechtonicaVR.VRCamera.Patch; | ||
|
||
[HarmonyPatch] | ||
class PlayerFirstPersonControllerPatch | ||
{ | ||
[HarmonyPatch(typeof(PlayerFirstPersonController), nameof(PlayerFirstPersonController.AutoCrouch))] | ||
[HarmonyPrefix] | ||
static bool AutoCrouchPatch() | ||
{ | ||
return true; | ||
} | ||
|
||
[HarmonyPrefix] | ||
[HarmonyPatch(typeof(PlayerFirstPersonController), nameof(PlayerFirstPersonController.UpdateThirdPersonView))] | ||
public static bool UpdateThirdPersonView() | ||
{ | ||
if (Player.instance.networkedPlayer) | ||
{ | ||
Player.instance.networkedPlayer.display.transform.position = Player.instance.transform.position; | ||
Player.instance.networkedPlayer.display.transform.rotation = Quaternion.Euler(0f, VRCameraManager.mainCamera.transform.rotation.eulerAngles.y, 0f); | ||
} | ||
return false; | ||
} | ||
} |
14 changes: 0 additions & 14 deletions
14
plugin/src/camera/patch/player_first_person_controller_patch.cs
This file was deleted.
Oops, something went wrong.