Tanoda
EnableDepthBuffer.cs
Go to the documentation of this file.
1
/******************************************************************************
2
* Copyright (C) Ultraleap, Inc. 2011-2020. *
3
* *
4
* Use subject to the terms of the Apache License 2.0 available at *
5
* http://www.apache.org/licenses/LICENSE-2.0, or another agreement *
6
* between Ultraleap and you, your company or other organization. *
7
******************************************************************************/
8
9
using
UnityEngine
;
10
using
System.Collections;
11
12
namespace
Leap.Unity
{
13
[ExecuteInEditMode]
14
public
class
EnableDepthBuffer
: MonoBehaviour {
15
public
const
string
DEPTH_TEXTURE_VARIANT_NAME
=
"USE_DEPTH_TEXTURE"
;
16
17
[SerializeField]
18
private
DepthTextureMode _depthTextureMode = DepthTextureMode.Depth;
19
20
void
Awake() {
21
GetComponent<Camera>().depthTextureMode = _depthTextureMode;
22
23
if
(SystemInfo.SupportsRenderTextureFormat(RenderTextureFormat.Depth) &&
24
_depthTextureMode != DepthTextureMode.None) {
25
Shader.EnableKeyword(
DEPTH_TEXTURE_VARIANT_NAME
);
26
}
else
{
27
Shader.DisableKeyword(
DEPTH_TEXTURE_VARIANT_NAME
);
28
}
29
}
30
}
31
}
Leap.Unity.EnableDepthBuffer
Definition:
EnableDepthBuffer.cs:14
Leap.Unity.EnableDepthBuffer.DEPTH_TEXTURE_VARIANT_NAME
const string DEPTH_TEXTURE_VARIANT_NAME
Definition:
EnableDepthBuffer.cs:15
Leap.Unity
Definition:
AssetFolderPropertyDrawer.cs:15
UnityEngine
Definition:
HSVPicker/UtilityScripts/BoxSlider.cs:7
Source
Assets
Plugins
LeapMotion
Core
Scripts
Utils
EnableDepthBuffer.cs
Generated by
1.9.3