-
-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Added config option to enable a popup asking for VR on startup - Rewrote serialization for DNet - Added a camera watchdog that detects when no XR rendering camera is active - Fixed door interactors not changing size of somebody else interacts with them
- Loading branch information
Showing
24 changed files
with
479 additions
and
285 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
# 1.2.0 | ||
# 1.2.0 | ||
|
||
## Settings Menu | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
# Compiling | ||
# Compiling | ||
|
||
## Initial setup | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
# Documentation | ||
# Documentation | ||
|
||
This directory will store all the documentation for thunderstore pages and the LCVR API |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
using System.Collections; | ||
using System.Linq; | ||
using UnityEngine; | ||
using UnityEngine.Rendering.HighDefinition; | ||
|
||
namespace LCVR.Experiments; | ||
|
||
/// <summary> | ||
/// This behaviour attempts to detect when the XR rendering is failing due to no active XR cameras being present in | ||
/// the scene. If this is the case, it will log warnings into the console. | ||
/// </summary> | ||
public class CameraWatchdog : MonoBehaviour | ||
{ | ||
private static Camera ActiveCamera => Camera.allCameras.FirstOrDefault(cam => cam.targetTexture == null); | ||
|
||
private int cameraMisses; | ||
|
||
private void Awake() | ||
{ | ||
StartCoroutine(checkForActiveCameraLoop()); | ||
} | ||
|
||
private IEnumerator checkForActiveCameraLoop() | ||
{ | ||
while (true) | ||
{ | ||
var activeCamera = ActiveCamera; | ||
cameraMisses = Mathf.Clamp(cameraMisses, 0, 5); | ||
|
||
if (cameraMisses > 5) | ||
{ | ||
Logger.LogWarning("[CameraWatchdog] Unresponsive XR rendering setup detected!"); | ||
Logger.LogWarning($"[CameraWatchdog] Current active camera: {(activeCamera ? activeCamera : "<NONE>")}"); | ||
} | ||
|
||
yield return new WaitForSeconds(2f); | ||
|
||
if (activeCamera is null) | ||
{ | ||
cameraMisses++; | ||
continue; | ||
} | ||
|
||
var hdCamera = activeCamera.GetComponent<HDAdditionalCameraData>(); | ||
if (hdCamera.xrRendering) | ||
{ | ||
cameraMisses--; | ||
continue; | ||
} | ||
|
||
cameraMisses++; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.