Testing for render pipeline type before load libraries

Hi everyone,

I’m building shader for both URP and HDRP pipelines using custom shaderGUI, but erros popup when one of the pipelines is not installed. I noticed that all erros are caused by the custom shaderGUI. There’s a way to test which packages are installed and put some statement on the custom shaderGUI to avoid this errors?

Thanks

Yes, the Package Manager has an API: Unity - Manual: Scripting API for packages

Thank you!!!