fix: error if MergeArmature is not under an avatar (#455)

This commit is contained in:
anatawa12 2023-09-27 18:34:20 +09:00 committed by GitHub
parent 64816e7e3c
commit 01ca90fd86
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -101,8 +101,7 @@ namespace nadena.dev.modular_avatar.core.editor
EditorGUILayout.Separator();
var enable_name_assignment =
target.mergeTarget.Get(RuntimeUtil.FindAvatarInParents(target.transform)) != null;
var enable_name_assignment = target.mergeTarget.Get(target) != null;
using (var scope = new EditorGUI.DisabledScope(!enable_name_assignment))
{
if (GUILayout.Button(G("merge_armature.adjust_names")))
@ -114,4 +113,4 @@ namespace nadena.dev.modular_avatar.core.editor
Localization.ShowLanguageUI();
}
}
}
}