-
-
Save Hugosslade/08a7cccd0f369bb135a08616e824f187 to your computer and use it in GitHub Desktop.
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
using UnityEngine; | |
using System.Collections; | |
[RequireComponent(typeof(Camera))] | |
public class DepthCamera : MonoBehaviour { | |
#region Serialized | |
public DepthTextureMode m_DepthMode = DepthTextureMode.Depth; | |
#endregion | |
#region Components | |
private Camera _Camera = null; | |
public Camera m_Camera { | |
get { | |
if (_Camera == null) { | |
_Camera = GetComponent<Camera> (); | |
} | |
return _Camera; | |
} | |
} | |
#endregion | |
#region Lifecycle | |
private void Awake() | |
{ | |
m_Camera.depthTextureMode = m_DepthMode; | |
} | |
#endregion | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment