From 29e20413129bb2a33438aa8b140f79421e92f4fe Mon Sep 17 00:00:00 2001 From: Ao_425 <127580611+Tliks@users.noreply.github.com> Date: Sun, 3 Nov 2024 07:20:13 +0900 Subject: [PATCH] chore: Add mesh settings regardless of parent presence in Setup Outfit (#1322) * chore: remove parent check for adding meshsettings * chore: a little refactoring --- Editor/SetupOutfit.cs | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/Editor/SetupOutfit.cs b/Editor/SetupOutfit.cs index f82510a3..4259209c 100644 --- a/Editor/SetupOutfit.cs +++ b/Editor/SetupOutfit.cs @@ -233,15 +233,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 - && outfitRoot.GetComponentInParent() == 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