Files
JJBB/Assets/Project/Script/CameraDepthEnable.cs

13 lines
327 B
C#
Raw Normal View History

2024-08-23 15:49:34 +08:00
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class CameraDepthEnable : MonoBehaviour
{
private void Start()
{
var currentCamera = GetComponent<Camera>();
if (currentCamera != null)
currentCamera.depthTextureMode = DepthTextureMode.Depth;
}
}