Skip to content

Commit

Permalink
Continued work on reimplementing features
Browse files Browse the repository at this point in the history
* Fixed issue with certain components not showing
* Started reimplementation of prefabs
  • Loading branch information
ChunkTreasure1 committed Sep 26, 2023
1 parent 4d02f1f commit 52573af
Show file tree
Hide file tree
Showing 20 changed files with 834 additions and 695 deletions.
2 changes: 1 addition & 1 deletion Volt/Sandbox/src/Sandbox/Utility/AssetBrowserUtilities.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ namespace AssetBrowser
{
auto scene = CreateRef<Volt::Scene>("ExportMeshScene");

Volt::AssetManager::GetAsset<Volt::Prefab>(item->handle)->Instantiate(scene.get());
Volt::AssetManager::GetAsset<Volt::Prefab>(item->handle)->Instantiate(scene);
std::vector<Volt::Entity> meshEntities;

for (const auto& ent : scene->GetAllEntitiesWith<Volt::MeshComponent>())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ void ComponentPropertyUtility::DrawComponents(Weak<Volt::Scene> scene, Volt::Ent

if (compTypeDesc->IsHidden())
{
return;
break;
}

bool removeComp = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1207,7 +1207,7 @@ void AssetBrowserPanel::CreatePrefabAndSetupEntities(entt::entity id)
std::string name = tagComp.tag + ".vtprefab";
name.erase(std::remove_if(name.begin(), name.end(), ::isspace), name.end());

Ref<Volt::Prefab> prefab = Volt::AssetManager::CreateAsset<Volt::Prefab>(Volt::AssetManager::GetRelativePath(myCurrentDirectory->path), name, myEditorScene.get(), entity.GetID());
Ref<Volt::Prefab> prefab = Volt::AssetManager::CreateAsset<Volt::Prefab>(Volt::AssetManager::GetRelativePath(myCurrentDirectory->path), name, entity);
Volt::AssetManager::SaveAsset(prefab);

SetupEntityAsPrefab(entity.GetID(), prefab->handle);
Expand Down
4 changes: 2 additions & 2 deletions Volt/Sandbox/src/Sandbox/Window/Net/NetContractPanel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ void NetContractPanel::DrawActions()
Volt::NetContractContainer::Clear();
Volt::NetContractContainer::Load();
m_scene->RemoveEntity(Volt::Entity(m_entityId, m_scene.get()));
m_entityId = Volt::AssetManager::GetAsset<Volt::Prefab>(m_handle)->Instantiate(m_scene.get());
m_entityId = Volt::AssetManager::GetAsset<Volt::Prefab>(m_handle)->Instantiate(m_scene).GetID();
}
}
ImGui::SameLine();
Expand All @@ -113,7 +113,7 @@ void NetContractPanel::DrawActions()
}
if (m_handle != 0)
{
m_entityId = Volt::AssetManager::GetAsset<Volt::Prefab>(m_handle)->Instantiate(m_scene.get());
m_entityId = Volt::AssetManager::GetAsset<Volt::Prefab>(m_handle)->Instantiate(m_scene).GetID();
Volt::NetContractContainer::Clear();
Volt::NetContractContainer::Load();
}
Expand Down
Loading

0 comments on commit 52573af

Please sign in to comment.