From 3f002f08a47d93ee9dc8373a3d6af867ee56d16f Mon Sep 17 00:00:00 2001 From: Masataka SUMI Date: Thu, 24 Jun 2021 15:25:33 +0900 Subject: [PATCH] Refactoring --- Assets/VRM/Runtime/IO/VRMMaterialExporter.cs | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/Assets/VRM/Runtime/IO/VRMMaterialExporter.cs b/Assets/VRM/Runtime/IO/VRMMaterialExporter.cs index c97d56a1b..bf021f20b 100644 --- a/Assets/VRM/Runtime/IO/VRMMaterialExporter.cs +++ b/Assets/VRM/Runtime/IO/VRMMaterialExporter.cs @@ -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);