zombie_mp/Assets/KriptoFX/VolumetricBloodFX/Scripts/BFX_RenderDepth.cs
Sewmina Dilshan 68183e5317 initial
2021-08-23 13:28:33 +05:30

25 lines
557 B
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class BFX_RenderDepth : MonoBehaviour
{
DepthTextureMode defaultMode;
void OnEnable()
{
var cam = GetComponent<Camera>();
defaultMode = cam.depthTextureMode;
if (cam.renderingPath == RenderingPath.Forward)
{
cam.depthTextureMode |= DepthTextureMode.Depth;
}
}
// Update is called once per frame
void OnDisable()
{
GetComponent<Camera>().depthTextureMode = defaultMode;
}
}