暂无描述
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

ComponentUtility.cs 929B

1234567891011121314151617181920
  1. namespace UnityEngine.Rendering.Universal
  2. {
  3. /// <summary>
  4. /// Utility class for component checks.
  5. /// </summary>
  6. public static class ComponentUtility
  7. {
  8. /// <summary> Check if the provided camera is compatible with Universal Render Pipeline </summary>
  9. /// <param name="camera">The Camera to check</param>
  10. /// <returns>True if it is compatible, false otherwise</returns>
  11. public static bool IsUniversalCamera(Camera camera)
  12. => camera.GetComponent<UniversalAdditionalCameraData>() != null;
  13. /// <summary> Check if the provided light is compatible with Universal Render Pipeline </summary>
  14. /// <param name="light">The Light to check</param>
  15. /// <returns>True if it is compatible, false otherwise</returns>
  16. public static bool IsUniversalLight(Light light)
  17. => light.GetComponent<UniversalAdditionalLightData>() != null;
  18. }
  19. }