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.
This commit is contained in:
bd_ 2023-06-05 19:10:04 +09:00
parent d5c2b98a05
commit 095c2667a0

View File

@ -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);