version 2.0.0
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
namespace VIVE.OpenXR {
|
||||
public class DisableVisibilityMask
|
||||
{
|
||||
static GameObject Provider;
|
||||
|
||||
[RuntimeInitializeOnLoadMethod]
|
||||
static void Start()
|
||||
{
|
||||
Provider = new GameObject();
|
||||
Provider.AddComponent<VisibilityMaskDisabler>();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 2f48023d9309a7f4bb46ff61a3b9523f
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,37 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.XR;
|
||||
|
||||
namespace VIVE.OpenXR
|
||||
{
|
||||
public class VisibilityMaskDisabler : MonoBehaviour
|
||||
{
|
||||
const string TAG = "VisibilityMaskDisabler";
|
||||
void Enable()
|
||||
{
|
||||
DontDestroyOnLoad(gameObject);
|
||||
}
|
||||
|
||||
private void Update()
|
||||
{
|
||||
if (NeedWorkAround() && XRSettings.occlusionMaskScale != 0.0f)
|
||||
{
|
||||
Debug.Log(TAG + "Try set scale to 0");
|
||||
XRSettings.occlusionMaskScale = 0.0f;
|
||||
}
|
||||
}
|
||||
|
||||
bool NeedWorkAround()
|
||||
{
|
||||
if (SystemInfo.graphicsDeviceType == UnityEngine.Rendering.GraphicsDeviceType.Vulkan && (XRSettings.stereoRenderingMode == XRSettings.StereoRenderingMode.SinglePass || XRSettings.stereoRenderingMode == XRSettings.StereoRenderingMode.SinglePassMultiview))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a9a8ed5424d972e42a118a829088c5f2
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user