fix(editor): show missing components in multi-select inspector
This commit is contained in:
parent
2e5b2adb0c
commit
c0e9dc1efe
@ -8051,7 +8051,20 @@ public:
|
|||||||
if (const auto componentRegistry = editorContext.GetModuleRegistry().ResolveService<MetaCoreIComponentTypeRegistry>();
|
if (const auto componentRegistry = editorContext.GetModuleRegistry().ResolveService<MetaCoreIComponentTypeRegistry>();
|
||||||
componentRegistry != nullptr) {
|
componentRegistry != nullptr) {
|
||||||
for (const auto& descriptor : componentRegistry->GetComponentDescriptors()) {
|
for (const auto& descriptor : componentRegistry->GetComponentDescriptors()) {
|
||||||
if (descriptor.TypeId == "Transform" || descriptor.HasComponent(selectedObject)) {
|
if (descriptor.TypeId == "Transform") {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool anySelectedObjectCanReceiveComponent = false;
|
||||||
|
for (const MetaCoreId selectedId : editorContext.GetSelectedObjectIds()) {
|
||||||
|
const MetaCoreGameObject selectedGameObject = editorContext.GetScene().FindGameObject(selectedId);
|
||||||
|
if (selectedGameObject && !descriptor.HasComponent(selectedGameObject)) {
|
||||||
|
anySelectedObjectCanReceiveComponent = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!anySelectedObjectCanReceiveComponent) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user