mirror of
https://github.com/Raicuparta/nomai-vr.git
synced 2025-12-11 20:15:08 +01:00
33 lines
1.4 KiB
C#
33 lines
1.4 KiB
C#
using UnityEngine;
|
|
|
|
namespace NomaiVR.EffectFixes
|
|
{
|
|
internal class ProjectionStoneCameraFix : NomaiVRModule<NomaiVRModule.EmptyBehaviour, ProjectionStoneCameraFix.Patch>
|
|
{
|
|
protected override bool IsPersistent => false;
|
|
protected override OWScene[] Scenes => PlayableScenes;
|
|
|
|
public class Patch : NomaiVRPatch
|
|
{
|
|
public override void ApplyPatches()
|
|
{
|
|
Postfix<NomaiRemoteCameraPlatform>(nameof(NomaiRemoteCameraPlatform.SwitchToRemoteCamera), nameof(SwitchToRemoteCamera));
|
|
}
|
|
|
|
private static void SwitchToRemoteCamera(NomaiRemoteCameraPlatform ____slavePlatform, Transform ____playerHologram)
|
|
{
|
|
var camera = ____slavePlatform.GetOwnedCamera().transform;
|
|
if (camera.parent.name.Contains("Prefab_NOM_RemoteViewer"))
|
|
{
|
|
var parent = new GameObject("VrProjectionStoneCameraParent").transform;
|
|
parent.parent = ____playerHologram;
|
|
parent.localPosition = new Vector3(0, -2.5f, 0);
|
|
parent.localRotation = Quaternion.identity;
|
|
____slavePlatform.GetOwnedCamera().transform.parent = parent;
|
|
____playerHologram.Find("Traveller_HEA_Player_v2").gameObject.SetActive(false);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|