Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
T-rvw committed Sep 18, 2023
1 parent 2a59418 commit 7323ea2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion Engine/Source/Editor/UILayers/Inspector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -576,6 +576,10 @@ void Inspector::Update()
engine::SceneWorld* pSceneWorld = GetSceneWorld();
if (engine::Entity selectedEntity = pSceneWorld->GetSelectedEntity(); selectedEntity != engine::INVALID_ENTITY)
{
// Entity will be invalid in two cases : 1.Select nothing 2.The selected entity has been deleted
// Here we only want to capture the case 1 not to clear Inspector properties.
// For case 2, it still uses a valid entity to update but nothing updated.
// It is OK if we don't reuse the entity id intermediately.
m_lastSelectedEntity = selectedEntity;
}

Expand All @@ -595,9 +599,9 @@ void Inspector::Update()
details::UpdateComponentWidget<engine::SkyComponent>(pSceneWorld, m_lastSelectedEntity);
details::UpdateComponentWidget<engine::TerrainComponent>(pSceneWorld, m_lastSelectedEntity);
details::UpdateComponentWidget<engine::StaticMeshComponent>(pSceneWorld, m_lastSelectedEntity);
details::UpdateComponentWidget<engine::MaterialComponent>(pSceneWorld, m_lastSelectedEntity);
details::UpdateComponentWidget<engine::ParticleComponent>(pSceneWorld, m_lastSelectedEntity);
details::UpdateComponentWidget<engine::CollisionMeshComponent>(pSceneWorld, m_lastSelectedEntity);
details::UpdateComponentWidget<engine::MaterialComponent>(pSceneWorld, m_lastSelectedEntity);
details::UpdateComponentWidget<engine::ShaderVariantCollectionsComponent>(pSceneWorld, m_lastSelectedEntity);

#ifdef ENABLE_DDGI
Expand Down

0 comments on commit 7323ea2

Please sign in to comment.