SceneRenderPipeline.cs 574 B

12345678910111213141516171819202122232425
  1. using System;
  2. using UnityEngine;
  3. using UnityEngine.Rendering;
  4. /// <summary>
  5. /// Setup a specific render pipeline on scene loading.
  6. /// </summary>
  7. [ExecuteAlways]
  8. public class SceneRenderPipeline : MonoBehaviour
  9. {
  10. /// <summary>
  11. /// Scriptable Render Pipeline Asset to setup on scene load.
  12. /// </summary>
  13. public RenderPipelineAsset renderPipelineAsset;
  14. void OnEnable()
  15. {
  16. GraphicsSettings.renderPipelineAsset = renderPipelineAsset;
  17. }
  18. void OnValidate()
  19. {
  20. GraphicsSettings.renderPipelineAsset = renderPipelineAsset;
  21. }
  22. }