From 6b4a9d07dd0370646d139f20ad80e88c5a0067da Mon Sep 17 00:00:00 2001 From: tliks Date: Sat, 26 Oct 2024 19:12:01 +0900 Subject: [PATCH] chore: a little refactoring --- Editor/SetupOutfit.cs | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/Editor/SetupOutfit.cs b/Editor/SetupOutfit.cs index b9ab5dd5..7d659239 100644 --- a/Editor/SetupOutfit.cs +++ b/Editor/SetupOutfit.cs @@ -230,14 +230,19 @@ namespace nadena.dev.modular_avatar.core.editor var meshSettings = outfitRoot.GetComponent(); var mSInheritProbeAnchor = ModularAvatarMeshSettings.InheritMode.SetOrInherit; var mSInheritBounds = ModularAvatarMeshSettings.InheritMode.SetOrInherit; - if (outfitRoot != null - && meshSettings == null) + + if (outfitRoot != null) { - meshSettings = Undo.AddComponent(outfitRoot.gameObject); - } else if (outfitRoot != null && meshSettings != null) { - Undo.RecordObject(meshSettings, ""); - mSInheritProbeAnchor = meshSettings.InheritProbeAnchor; - mSInheritBounds = meshSettings.InheritBounds; + if (meshSettings == null) + { + meshSettings = Undo.AddComponent(outfitRoot.gameObject); + } + else + { + Undo.RecordObject(meshSettings, ""); + mSInheritProbeAnchor = meshSettings.InheritProbeAnchor; + mSInheritBounds = meshSettings.InheritBounds; + } } if (meshSettings != null