Avoid error for empty materials

This commit is contained in:
ousttrue 2018-09-26 21:10:00 +09:00
parent 08efedbab9
commit 2e46bd4247

View File

@ -36,6 +36,12 @@ namespace VRM
public override Material CreateMaterial(int i, glTFMaterial src)
{
if(i==0 && m_materials.Count == 0)
{
// dummy
return new Material(Shader.Find("Standard"));
}
var item = m_materials[i];
var shaderName = item.shader;
var shader = Shader.Find(shaderName);