Created
November 24, 2020 03:23
-
-
Save andreiagmu/b862ae47ef91be05f61ae2da26627a01 to your computer and use it in GitHub Desktop.
RenderPipeline helper class
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// RenderPipelineHelper | |
// by Andy Miira (Andrei Müller), November 2020 | |
using UnityEngine; | |
using UnityEngine.Rendering; | |
namespace MirrorMirai.Helpers | |
{ | |
public enum RenderPipelines | |
{ | |
BuiltIn, | |
URP, | |
HDRP | |
} | |
public static class RenderPipelineHelper | |
{ | |
public static RenderPipelines CheckRenderPipeline() | |
{ | |
if (GraphicsSettings.renderPipelineAsset) | |
{ | |
if (GraphicsSettings.renderPipelineAsset.GetType().ToString().Contains("HDRenderPipelineAsset")) | |
{ | |
// HDRP active | |
Debug.Log("HDRP active"); | |
return RenderPipelines.HDRP; | |
} | |
else | |
{ | |
// URP active | |
Debug.Log("URP active"); | |
return RenderPipelines.URP; | |
} | |
} | |
else | |
{ | |
// Built-in RP active | |
Debug.Log("Built-in RP active"); | |
return RenderPipelines.BuiltIn; | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment