mirror of
https://github.com/NotAKidoS/NAK_CVR_Mods.git
synced 2025-09-02 14:29:25 +00:00
[DesktopVRSwitch] More fixes for 2023r171.
This commit is contained in:
parent
9f01f8e6a7
commit
3d6b1f75a4
17 changed files with 67 additions and 62 deletions
|
@ -43,7 +43,7 @@ public class VRModeSwitchManager : MonoBehaviour
|
|||
|
||||
#region Public Methods
|
||||
|
||||
public static bool IsInXR() => XRGeneralSettings.Instance.Manager.activeLoader != null;
|
||||
private static bool IsInXR() => XRGeneralSettings.Instance.Manager.activeLoader != null;
|
||||
|
||||
public void AttemptSwitch() => StartCoroutine(StartSwitchInternal());
|
||||
|
||||
|
@ -56,10 +56,12 @@ public class VRModeSwitchManager : MonoBehaviour
|
|||
if (SwitchInProgress)
|
||||
yield break;
|
||||
|
||||
bool useWorldTransition = UseWorldTransition;
|
||||
SwitchInProgress = true;
|
||||
|
||||
yield return null;
|
||||
|
||||
if (UseWorldTransition)
|
||||
if (useWorldTransition)
|
||||
yield return StartCoroutine(StartTransition());
|
||||
|
||||
bool isUsingVr = IsInXR();
|
||||
|
@ -68,7 +70,7 @@ public class VRModeSwitchManager : MonoBehaviour
|
|||
|
||||
yield return StartCoroutine(XRAndReloadAvatar(!isUsingVr));
|
||||
|
||||
if (UseWorldTransition)
|
||||
if (useWorldTransition)
|
||||
yield return StartCoroutine(ContinueTransition());
|
||||
|
||||
SwitchInProgress = false;
|
||||
|
@ -145,7 +147,7 @@ public class VRModeSwitchManager : MonoBehaviour
|
|||
{
|
||||
try
|
||||
{
|
||||
var playerCamera = Utils.GetPlayerCameraObject(isUsingVr).GetComponent<Camera>();
|
||||
Camera playerCamera = Utils.GetPlayerCameraObject(isUsingVr).GetComponent<Camera>();
|
||||
switchEvent?.Invoke(this, new VRModeEventArgs(isUsingVr, playerCamera));
|
||||
}
|
||||
catch (Exception e)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue