mirror of
https://github.com/bdunderscore/modular-avatar.git
synced 2024-12-29 18:55:06 +08:00
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:
parent
a3b9acba39
commit
29e2041312
@ -233,16 +233,20 @@ 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)
|
{
|
||||||
|
if (meshSettings == null)
|
||||||
{
|
{
|
||||||
meshSettings = Undo.AddComponent<ModularAvatarMeshSettings>(outfitRoot.gameObject);
|
meshSettings = Undo.AddComponent<ModularAvatarMeshSettings>(outfitRoot.gameObject);
|
||||||
} else if (outfitRoot != null && meshSettings != null) {
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
Undo.RecordObject(meshSettings, "");
|
Undo.RecordObject(meshSettings, "");
|
||||||
mSInheritProbeAnchor = meshSettings.InheritProbeAnchor;
|
mSInheritProbeAnchor = meshSettings.InheritProbeAnchor;
|
||||||
mSInheritBounds = meshSettings.InheritBounds;
|
mSInheritBounds = meshSettings.InheritBounds;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (meshSettings != null
|
if (meshSettings != null
|
||||||
&& (meshSettings.ProbeAnchor == null || meshSettings.ProbeAnchor.Get(meshSettings) == null
|
&& (meshSettings.ProbeAnchor == null || meshSettings.ProbeAnchor.Get(meshSettings) == null
|
||||||
|
Loading…
Reference in New Issue
Block a user