chore: a little refactoring

This commit is contained in:
tliks 2024-10-26 19:12:01 +09:00
parent bebdb41424
commit 6b4a9d07dd

View File

@ -230,14 +230,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)
{ {
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