If urp is not installed, force it to use the built-in rendering pipeline

This commit is contained in:
ousttrue
2021-09-17 18:21:53 +09:00
parent 02cf0814d4
commit d9e9fc27bf
2 changed files with 24 additions and 0 deletions

View File

@@ -22,6 +22,18 @@ namespace UniGLTF
[Header("Experimental")]
public RenderPipelineTypes m_renderPipeline;
void OnValidate()
{
if (m_renderPipeline == UniGLTF.RenderPipelineTypes.UniversalRenderPipeline)
{
if (Shader.Find(UniGLTF.GltfPbrUrpMaterialImporter.ShaderName) == null)
{
Debug.LogWarning("URP is not installed. Force to BuiltinRenderPipeline");
m_renderPipeline = UniGLTF.RenderPipelineTypes.BuiltinRenderPipeline;
}
}
}
static IMaterialDescriptorGenerator GetMaterialGenerator(RenderPipelineTypes renderPipeline)
{
switch (renderPipeline)

View File

@@ -21,5 +21,17 @@ namespace UniVRM10
{
VrmScriptedImporterImpl.Import(this, ctx, MigrateToVrm1, RenderPipeline);
}
void OnValidate()
{
if (RenderPipeline == UniGLTF.RenderPipelineTypes.UniversalRenderPipeline)
{
if (Shader.Find(UniGLTF.GltfPbrUrpMaterialImporter.ShaderName) == null)
{
Debug.LogWarning("URP is not installed. Force to BuiltinRenderPipeline");
RenderPipeline = UniGLTF.RenderPipelineTypes.BuiltinRenderPipeline;
}
}
}
}
}