未验证 提交 12589ae7 编写于 作者: M Mr.doob 提交者: GitHub

Merge pull request #16868 from takahirox/XRNotFoundButton

WebVR: Use XR NOT FOUND string with WebXR API
...@@ -93,7 +93,7 @@ var WEBVR = { ...@@ -93,7 +93,7 @@ var WEBVR = {
} }
function showVRNotFound() { function disableButton() {
button.style.display = ''; button.style.display = '';
...@@ -101,17 +101,31 @@ var WEBVR = { ...@@ -101,17 +101,31 @@ var WEBVR = {
button.style.left = 'calc(50% - 75px)'; button.style.left = 'calc(50% - 75px)';
button.style.width = '150px'; button.style.width = '150px';
button.textContent = 'VR NOT FOUND';
button.onmouseenter = null; button.onmouseenter = null;
button.onmouseleave = null; button.onmouseleave = null;
button.onclick = null; button.onclick = null;
}
function showVRNotFound() {
disableButton();
button.textContent = 'VR NOT FOUND';
renderer.vr.setDevice( null ); renderer.vr.setDevice( null );
} }
function showXRNotFound() {
disableButton();
button.textContent = 'XR NOT FOUND';
}
function stylizeElement( element ) { function stylizeElement( element ) {
element.style.position = 'absolute'; element.style.position = 'absolute';
...@@ -136,7 +150,7 @@ var WEBVR = { ...@@ -136,7 +150,7 @@ var WEBVR = {
stylizeElement( button ); stylizeElement( button );
navigator.xr.supportsSession( 'immersive-vr' ).then( showEnterXR ).catch( showVRNotFound ); navigator.xr.supportsSession( 'immersive-vr' ).then( showEnterXR ).catch( showXRNotFound );
return button; return button;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册