ComponentUtility.cs 848 B

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