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.
22 lines
480 B
22 lines
480 B
// |
|
// Attach this script to your camera in order to use depth nodes in forward rendering |
|
// |
|
|
|
using UnityEngine; |
|
using System.Collections; |
|
|
|
[RequireComponent(typeof(Camera))] |
|
public class EnableCameraDepthInForward : MonoBehaviour { |
|
#if UNITY_EDITOR |
|
void OnDrawGizmos(){ |
|
Set(); |
|
} |
|
#endif |
|
void Start () { |
|
Set(); |
|
} |
|
void Set(){ |
|
if(GetComponent<Camera>().depthTextureMode == DepthTextureMode.None) |
|
GetComponent<Camera>().depthTextureMode = DepthTextureMode.Depth; |
|
} |
|
}
|
|
|