fix warning

Alpha cutoff is supported only for 'MASK' alpha mode.
This commit is contained in:
ousttrue 2020-09-24 15:19:31 +09:00
parent e76e2f9671
commit 361954aa9d
2 changed files with 2 additions and 2 deletions

View File

@ -80,7 +80,7 @@ namespace UniGLTF
{"gltf/meshes[]/primitives[]/extras", "if(value.extras!=null && value.extras.targetNames!=null && value.extras.targetNames.Count>0)"},
{"gltf/meshes[]/weights", "if(value.weights!=null && value.weights.Length>0)" },
{"gltf/materials", "if(value.materials!=null && value.materials.Count>0)" },
{"gltf/materials[]/alphaCutoff", "if(!string.IsNullOrEmpty(value.alphaMode))" },
{"gltf/materials[]/alphaCutoff", "if(value.alphaMode == \"MASK\")" },
{"gltf/nodes", "if(value.nodes!=null && value.nodes.Count>0)" },
{"gltf/nodes[]/camera", "if(value.camera!=-1)"},
{"gltf/nodes[]/mesh", "if(value.mesh!=-1)"},

View File

@ -572,7 +572,7 @@ namespace UniGLTF {
f.Key("alphaMode"); f.GenSerialize(value.alphaMode);
}
if(!string.IsNullOrEmpty(value.alphaMode))
if(value.alphaMode == "MASK")
{
f.Key("alphaCutoff"); f.GenSerialize(value.alphaCutoff);
}