NAK_CVR_Mods/DesktopVRSwitch/Utils.cs
NotAKidoS 5f95755ad2 [DesktopVRSwitch] Reworked SteamVR Initialization
New SteamVR initialization to avoid warnings/errors on switch.
2023-06-19 21:26:57 -05:00

34 lines
902 B
C#

using ABI_RC.Core.EventSystem;
using ABI_RC.Core.Player;
using ABI_RC.Core.Savior;
using ABI_RC.Systems.MovementSystem;
using UnityEngine;
namespace NAK.DesktopVRSwitch;
internal static class Utils
{
internal static GameObject GetPlayerCameraObject(bool intoVR)
{
if (intoVR)
{
return PlayerSetup.Instance.vrCamera;
}
return PlayerSetup.Instance.desktopCamera;
}
//stole from kafe :>
internal static Vector3 GetPlayerRootPosition()
{
return MovementSystem.Instance.rotationPivot.position with
{
y = MovementSystem.Instance.transform.position.y
};
}
internal static void ReloadLocalAvatar()
{
DesktopVRSwitch.Logger.Msg("Attempting to reload current local avatar from GUID.");
AssetManagement.Instance.LoadLocalAvatar(MetaPort.Instance.currentAvatarGuid);
}
}