fix UseUnlit

This commit is contained in:
ousttrue 2020-08-03 15:11:42 +09:00
parent cc353d1b10
commit ca3f9cb835
3 changed files with 19 additions and 17 deletions

View File

@ -199,21 +199,6 @@ namespace UniGLTF
}
}
public static bool UseUnlit(string shaderName)
{
switch (shaderName)
{
case "Unlit/Color":
case "Unlit/Texture":
case "Unlit/Transparent":
case "Unlit/Transparent Cutout":
case "UniGLTF/UniUnlit":
return true;
}
return false;
}
protected virtual glTFMaterial CreateMaterial(Material m)
{
switch (m.shader.name)

View File

@ -228,7 +228,7 @@ namespace VRM
continue;
}
if (MaterialExporter.UseUnlit(material.shader.name))
if (VRMMaterialExporter.UseUnlit(material.shader.name))
{
// unlit
continue;
@ -240,7 +240,7 @@ namespace VRM
continue;
}
yield return Validation.Warning(string.Format("{0}: unknown material '{0}' is used. this will export as `Standard` fallback",
yield return Validation.Warning(string.Format("{0}: unknown shader '{1}' is used. this will export as `Standard` fallback",
material.name,
material.shader.name));
}

View File

@ -10,6 +10,23 @@ namespace VRM
{
public class VRMMaterialExporter : MaterialExporter
{
public static bool UseUnlit(string shaderName)
{
switch (shaderName)
{
case "Unlit/Color":
case "Unlit/Texture":
case "Unlit/Transparent":
case "Unlit/Transparent Cutout":
case "UniGLTF/UniUnlit":
case "VRM/UnlitTexture":
case "VRM/UnlitTransparent":
case "VRM/UnlitCutout":
return true;
}
return false;
}
protected override glTFMaterial CreateMaterial(Material m)
{
switch (m.shader.name)