using UnityEngine; using System.Collections; namespace CalmWater { [ExecuteInEditMode] [RequireComponent(typeof(Camera))] public class CameraDepthMode : MonoBehaviour { void Start () { GetComponent().depthTextureMode = DepthTextureMode.Depth; } void OnEnable(){ GetComponent().depthTextureMode = DepthTextureMode.Depth; } void OnDisable(){ GetComponent().depthTextureMode = DepthTextureMode.None; } } }