chore: Add mesh settings regardless of parent presence in Setup Outfit (#1322)

* chore: remove parent check for adding meshsettings

* chore: a little refactoring
This commit is contained in:
Ao_425 2024-11-03 07:20:13 +09:00 committed by GitHub
parent a3b9acba39
commit 29e2041312
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -233,15 +233,19 @@ namespace nadena.dev.modular_avatar.core.editor
var meshSettings = outfitRoot.GetComponent<ModularAvatarMeshSettings>(); var meshSettings = outfitRoot.GetComponent<ModularAvatarMeshSettings>();
var mSInheritProbeAnchor = ModularAvatarMeshSettings.InheritMode.SetOrInherit; var mSInheritProbeAnchor = ModularAvatarMeshSettings.InheritMode.SetOrInherit;
var mSInheritBounds = ModularAvatarMeshSettings.InheritMode.SetOrInherit; var mSInheritBounds = ModularAvatarMeshSettings.InheritMode.SetOrInherit;
if (outfitRoot != null
&& meshSettings == null if (outfitRoot != null)
&& outfitRoot.GetComponentInParent<ModularAvatarMeshSettings>() == null)
{ {
meshSettings = Undo.AddComponent<ModularAvatarMeshSettings>(outfitRoot.gameObject); if (meshSettings == null)
} else if (outfitRoot != null && meshSettings != null) { {
Undo.RecordObject(meshSettings, ""); meshSettings = Undo.AddComponent<ModularAvatarMeshSettings>(outfitRoot.gameObject);
mSInheritProbeAnchor = meshSettings.InheritProbeAnchor; }
mSInheritBounds = meshSettings.InheritBounds; else
{
Undo.RecordObject(meshSettings, "");
mSInheritProbeAnchor = meshSettings.InheritProbeAnchor;
mSInheritBounds = meshSettings.InheritBounds;
}
} }
if (meshSettings != null if (meshSettings != null