mirror of
https://github.com/NotAKidoS/NAK_CVR_Mods.git
synced 2025-09-02 06:19:22 +00:00
[ThirdPerson] Fixed VRSwitch issue, fixed Zoom check NRE
This commit is contained in:
parent
e12da22513
commit
312ce65a28
3 changed files with 8 additions and 13 deletions
|
@ -34,7 +34,9 @@ internal static class CameraLogic
|
|||
get => _state;
|
||||
set
|
||||
{
|
||||
if (_state == value) return;
|
||||
_state = !CheckIsRestricted() && value;
|
||||
|
||||
if (_state) _storedCamMask = _desktopCam.cullingMask;
|
||||
_desktopCam.cullingMask = _state ? 0 : _storedCamMask;
|
||||
_uiCam.cullingMask = _state ? _uiCam.cullingMask & ~(1 << CVRLayers.PlayerClone) : _uiCam.cullingMask | (1 << CVRLayers.PlayerClone);
|
||||
|
@ -114,14 +116,7 @@ internal static class CameraLogic
|
|||
internal static void ScrollDist(float sign) { _dist += sign * 0.25f; RelocateCam(CurrentLocation); }
|
||||
internal static void AdjustScale(float height) { _scale = height; RelocateCam(CurrentLocation); }
|
||||
internal static void CheckVRMode() { if (MetaPort.Instance.isUsingVr) State = false; }
|
||||
|
||||
private static bool CheckIsRestricted()
|
||||
=> !CVRWorld.Instance.enableZoom;
|
||||
|
||||
internal static bool ShouldNotHideHead_ThirdPerson(Camera cam)
|
||||
{
|
||||
if (cam != _desktopCam)
|
||||
return true; // we dont care
|
||||
|
||||
return !State;
|
||||
}
|
||||
=> CVRWorld.Instance != null && !CVRWorld.Instance.enableZoom;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue