Skip to content

Instantly share code, notes, and snippets.

@Hugosslade
Created November 10, 2016 13:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Hugosslade/08a7cccd0f369bb135a08616e824f187 to your computer and use it in GitHub Desktop.
Save Hugosslade/08a7cccd0f369bb135a08616e824f187 to your computer and use it in GitHub Desktop.
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