diff --git a/Assets/UniGLTF/Runtime/UniGLTF/IO/MaterialIO/URP/Export/Materials/UrpLitMaterialExporter.cs b/Assets/UniGLTF/Runtime/UniGLTF/IO/MaterialIO/URP/Export/Materials/UrpLitMaterialExporter.cs index 2fca9ea28..3ae4807ee 100644 --- a/Assets/UniGLTF/Runtime/UniGLTF/IO/MaterialIO/URP/Export/Materials/UrpLitMaterialExporter.cs +++ b/Assets/UniGLTF/Runtime/UniGLTF/IO/MaterialIO/URP/Export/Materials/UrpLitMaterialExporter.cs @@ -25,7 +25,7 @@ namespace UniGLTF { if (src == null) throw new ArgumentNullException(nameof(src)); if (textureExporter == null) throw new ArgumentNullException(nameof(textureExporter)); - if (src.shader != Shader) throw new UniGLTFShaderNotMatchedInternalException(src.shader); + if (src.shader != Shader || Shader == null) throw new UniGLTFShaderNotMatchedInternalException(src.shader); dst = new glTFMaterial { diff --git a/Assets/UniGLTF/Runtime/UniGLTF/IO/MaterialIO/URP/Export/Materials/UrpUniUnlitMaterialExporter.cs b/Assets/UniGLTF/Runtime/UniGLTF/IO/MaterialIO/URP/Export/Materials/UrpUniUnlitMaterialExporter.cs index 8f68209a4..05670b81a 100644 --- a/Assets/UniGLTF/Runtime/UniGLTF/IO/MaterialIO/URP/Export/Materials/UrpUniUnlitMaterialExporter.cs +++ b/Assets/UniGLTF/Runtime/UniGLTF/IO/MaterialIO/URP/Export/Materials/UrpUniUnlitMaterialExporter.cs @@ -24,7 +24,7 @@ namespace UniGLTF { if (src == null) throw new ArgumentNullException(nameof(src)); if (textureExporter == null) throw new ArgumentNullException(nameof(textureExporter)); - if (src.shader != Shader) throw new UniGLTFShaderNotMatchedInternalException(src.shader); + if (src.shader != Shader || Shader == null) throw new UniGLTFShaderNotMatchedInternalException(src.shader); dst = glTF_KHR_materials_unlit.CreateDefault(); dst.name = src.name; diff --git a/Assets/UniGLTF/Runtime/UniGLTF/IO/MaterialIO/URP/Export/Materials/UrpUnlitMaterialExporter.cs b/Assets/UniGLTF/Runtime/UniGLTF/IO/MaterialIO/URP/Export/Materials/UrpUnlitMaterialExporter.cs index df8523d8c..67659c474 100644 --- a/Assets/UniGLTF/Runtime/UniGLTF/IO/MaterialIO/URP/Export/Materials/UrpUnlitMaterialExporter.cs +++ b/Assets/UniGLTF/Runtime/UniGLTF/IO/MaterialIO/URP/Export/Materials/UrpUnlitMaterialExporter.cs @@ -23,7 +23,7 @@ namespace UniGLTF { if (src == null) throw new ArgumentNullException(nameof(src)); if (textureExporter == null) throw new ArgumentNullException(nameof(textureExporter)); - if (src.shader != Shader) throw new UniGLTFShaderNotMatchedInternalException(src.shader); + if (src.shader != Shader || Shader == null) throw new UniGLTFShaderNotMatchedInternalException(src.shader); dst = glTF_KHR_materials_unlit.CreateDefault(); dst.name = src.name;