mirror of
https://github.com/NotAKidoS/NAK_CVR_Mods.git
synced 2025-09-02 14:29:25 +00:00
Move many mods to Deprecated folder, fix spelling
This commit is contained in:
parent
5e822cec8d
commit
0042590aa6
539 changed files with 7475 additions and 3120 deletions
42
.Deprecated/DesktopVRSwitch/VRModeSwitchDebugger.cs
Normal file
42
.Deprecated/DesktopVRSwitch/VRModeSwitchDebugger.cs
Normal file
|
@ -0,0 +1,42 @@
|
|||
using System.Collections;
|
||||
using UnityEngine;
|
||||
|
||||
namespace NAK.DesktopVRSwitch;
|
||||
|
||||
internal class VRModeSwitchDebugger : MonoBehaviour
|
||||
{
|
||||
private Coroutine _switchCoroutine;
|
||||
private WaitForSeconds _sleep;
|
||||
|
||||
private void OnEnable()
|
||||
{
|
||||
if (_switchCoroutine != null)
|
||||
return;
|
||||
|
||||
_switchCoroutine = StartCoroutine(SwitchLoop());
|
||||
_sleep = new WaitForSeconds(2f);
|
||||
}
|
||||
|
||||
private void OnDisable()
|
||||
{
|
||||
if (_switchCoroutine == null)
|
||||
return;
|
||||
|
||||
StopCoroutine(_switchCoroutine);
|
||||
_switchCoroutine = null;
|
||||
_sleep = null;
|
||||
}
|
||||
|
||||
private IEnumerator SwitchLoop()
|
||||
{
|
||||
while (true)
|
||||
{
|
||||
if (!VRModeSwitchManager.Instance.SwitchInProgress)
|
||||
{
|
||||
VRModeSwitchManager.Instance.AttemptSwitch();
|
||||
yield return _sleep;
|
||||
}
|
||||
yield return null;
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue