Skip to content
This repository has been archived by the owner on Mar 12, 2022. It is now read-only.

Commit

Permalink
Add compatibility with Oculus version.
Browse files Browse the repository at this point in the history
  • Loading branch information
nitrog0d committed Mar 5, 2021
1 parent cd1d120 commit 570b2d2
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions TrackingRotatorMod.cs
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
using MelonLoader;
using UIExpansionKit.API;
using UnityEngine;
using System.Linq;
using UnhollowerRuntimeLib;
using Il2CppSystem.Reflection;

namespace TrackingRotator {

public static class ModBuildInfo {
public const string Name = "TrackingRotator";
public const string Author = "nitro.";
public const string Version = "1.0.0";
public const string Version = "1.0.1";
public const string DownloadLink = "https://github.com/nitrog0d/TrackingRotator/releases/latest/download/TrackingRotator.dll";
public const string GameDeveloper = "VRChat";
public const string Game = "VRChat";
Expand Down Expand Up @@ -48,7 +51,9 @@ public override void OnPreferencesSaved() {
}

public override void VRChat_OnUiManagerInit() {
cameraTransform = Object.FindObjectOfType<VRCVrCameraSteam>().field_Public_Transform_0;
var camera = Object.FindObjectOfType<VRCVrCamera>();
var transform = camera.GetIl2CppType().GetFields(BindingFlags.Public | BindingFlags.Instance).Where(f => f.FieldType == Il2CppType.Of<Transform>()).ToArray()[0];
cameraTransform = transform.GetValue(camera).Cast<Transform>();
originalRotation = cameraTransform.localRotation;
}

Expand Down

0 comments on commit 570b2d2

Please sign in to comment.