using UnityEngine; using System.Collections; [ExecuteInEditMode] public class EnableDepthBuffer : MonoBehaviour { void Awake() { GetComponent().depthTextureMode = DepthTextureMode.Depth; } }