Refactoring

This commit is contained in:
Masataka SUMI
2021-06-24 15:25:33 +09:00
parent 8e4cfafcf5
commit 3f002f08a4

View File

@@ -180,10 +180,17 @@ namespace VRM
var texture = m.GetTexture(kv.Key);
if (texture != null)
{
var value = kv.Key == "_BumpMap"
? textureExporter.RegisterExportingAsNormal(texture)
: textureExporter.RegisterExportingAsSRgb(texture, needsAlpha: kv.Key == "_MainTex")
;
var value = -1;
var isNormalMap = kv.Key == "_BumpMap";
if (isNormalMap)
{
value = textureExporter.RegisterExportingAsNormal(texture);
}
else
{
var needsAlpha = kv.Key == "_MainTex";
value = textureExporter.RegisterExportingAsSRgb(texture, needsAlpha);
}
if (value == -1)
{
Debug.LogFormat("not found {0}", texture.name);