暫無描述
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.

ControlLayerCulling.cs 711B

12345678910111213141516171819
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. public class ControlLayerCulling : MonoBehaviour
  5. {
  6. void Start()
  7. {
  8. Camera camera = GetComponent<Camera>();
  9. float[] distances = new float[32];
  10. distances[0] = 0; // Default Layer - 0 will be ignored and left unscaled which results in the far clipping plane
  11. distances[1] = 200; // TransparentFX Layer - red objects
  12. distances[2] = 400; // Ignore Raycast Layer - green objects
  13. distances[3] = 900; // empty Layer
  14. distances[4] = 1500; // Water Layer - blue objects
  15. // ignoring the rest for this demo (same as 0)
  16. camera.layerCullDistances = distances;
  17. }
  18. }