From 095c2667a0e6a9fb6fd05b3f3636188c6cc96c3c Mon Sep 17 00:00:00 2001 From: bd_ Date: Mon, 5 Jun 2023 19:10:04 +0900 Subject: [PATCH] fix: MA Menu Item was showing a spurious gizmo icon Fix this for new components as well by using reflection to find all avatar tag components and remove the gizmos appropriately. --- .../nadena.dev.modular-avatar/Editor/Util.cs | 21 +++++++++---------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/Packages/nadena.dev.modular-avatar/Editor/Util.cs b/Packages/nadena.dev.modular-avatar/Editor/Util.cs index 5b5ecc0a..b9843e5f 100644 --- a/Packages/nadena.dev.modular-avatar/Editor/Util.cs +++ b/Packages/nadena.dev.modular-avatar/Editor/Util.cs @@ -125,17 +125,16 @@ namespace nadena.dev.modular_avatar.core.editor return; } - SetGizmoIconEnabled(typeof(ModularAvatarBoneProxy), false); - SetGizmoIconEnabled(typeof(ModularAvatarBoundsOverride), false); - SetGizmoIconEnabled(typeof(ModularAvatarBoundsOverrideBlocker), false); - SetGizmoIconEnabled(typeof(ModularAvatarProbeAnchor), false); - SetGizmoIconEnabled(typeof(ModularAvatarBlendshapeSync), false); - SetGizmoIconEnabled(typeof(ModularAvatarMenuInstaller), false); - SetGizmoIconEnabled(typeof(ModularAvatarMergeAnimator), false); - SetGizmoIconEnabled(typeof(ModularAvatarMergeArmature), false); - SetGizmoIconEnabled(typeof(ModularAvatarParameters), false); - SetGizmoIconEnabled(typeof(ModularAvatarPBBlocker), false); - SetGizmoIconEnabled(typeof(ModularAvatarVisibleHeadAccessory), false); + foreach (var assembly in AppDomain.CurrentDomain.GetAssemblies()) + { + foreach (var ty in assembly.GetTypes()) + { + if (typeof(AvatarTagComponent).IsAssignableFrom(ty) && !ty.IsAbstract) + { + SetGizmoIconEnabled(ty, false); + } + } + } EditorApplication.update -= DisableMAGizmoIcons; SessionState.GetBool("MAIconsDisabled", true);