You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

21 lines
567 B

5 years ago
  1. using UnityEngine;
  2. using System.Collections;
  3. [ExecuteInEditMode]
  4. public class EnableDepthInForwardCamera : MonoBehaviour {
  5. public string Message = "Add this script to generate depth if Fog Volume rendered is not used and rendering path is forward";
  6. // Use this for initialization
  7. void OnEnable() {
  8. }
  9. // Update is called once per frame
  10. void Update()
  11. {
  12. if (GetComponent<Camera>().depthTextureMode != DepthTextureMode.Depth)
  13. GetComponent<Camera>().depthTextureMode |= DepthTextureMode.Depth;
  14. }
  15. }