mirror of
https://github.com/vrm-c/UniVRM.git
synced 2026-08-23 02:55:07 -05:00
add exporting support UniUnlit in URP
This commit is contained in:
@@ -4,15 +4,17 @@ namespace UniGLTF
|
||||
{
|
||||
public class UrpGltfMaterialExporter : IMaterialExporter
|
||||
{
|
||||
private readonly UrpLitMaterialExporter _litExporter = new();
|
||||
public UrpLitMaterialExporter UrpLitExporter { get; set; } = new();
|
||||
public UrpUniUnlitMaterialExporter UrpUniUnlitExporter { get; set; } = new();
|
||||
public UrpFallbackMaterialExporter FallbackExporter { get; set; } = new();
|
||||
|
||||
public glTFMaterial ExportMaterial(Material m, ITextureExporter textureExporter, GltfExportSettings settings)
|
||||
{
|
||||
glTFMaterial dst;
|
||||
if (UrpLitExporter.TryExportMaterial(m, textureExporter, out var dst)) return dst;
|
||||
if (UrpUniUnlitExporter.TryExportMaterial(m, textureExporter, out dst)) return dst;
|
||||
|
||||
if (_litExporter.TryExportMaterial(m, textureExporter, out dst)) return dst;
|
||||
|
||||
return dst;
|
||||
Debug.Log($"Material `{m.name}` fallbacks.");
|
||||
return FallbackExporter.ExportMaterial(m, textureExporter);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user