Merge pull request #1232 from ousttrue/fix/force_builtin_if_urp_not_installed

URP 未インストール時に、URPを選択できないように修正
This commit is contained in:
PoChang007
2021-09-17 18:28:36 +09:00
committed by GitHub
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;
}
}
}
}
}