add trace for imgui.ini, add assets manager system and objects manager system, add some icons, add entity tree node for scene Hierachy's entities, add convert blend file process(but not actual use it, just implement) BUGS: file copy not work

This commit is contained in:
2026-01-21 12:30:47 +08:00
parent 2bfde2dfb0
commit cf3a46bae1
50 changed files with 1553 additions and 73 deletions

View File

@ -15,6 +15,7 @@
#include "Prism/Physics/Physics3D.h"
#include "Prism/Renderer/Renderer2D.h"
#include "Prism/Script/ScriptEngine.h"
#include "Prism/Utilities/DragDropData.h"
namespace Prism
{
@ -171,6 +172,9 @@ namespace Prism
m_SceneHierarchyPanel->SetEntityDeletedCallback(std::bind(&EditorLayer::OnEntityDeleted, this, std::placeholders::_1));
UpdateWindowTitle("untitled Scene");
m_AssetManagerPanel = CreateScope<AssetsManagerPanel>();
m_ObjectsPanel = CreateScope<ObjectsPanel>();
// OpenScene("assets/scenes/FPSDemo.scene");
NewScene();
}
@ -654,6 +658,9 @@ namespace Prism
if (m_UIShowBoundingBoxes && Property("On Top", m_UIShowBoundingBoxesOnTop))
ShowBoundingBoxes(m_UIShowBoundingBoxes, m_UIShowBoundingBoxesOnTop);
m_AssetManagerPanel->OnImGuiRender();
m_ObjectsPanel->OnImGuiRender();
const char* label = m_SelectionMode == SelectionMode::Entity ? "Entity" : "Mesh";
if (ImGui::Button(label))
{
@ -835,6 +842,44 @@ namespace Prism
}
}
if (ImGui::BeginDragDropTarget())
{
auto payload = ImGui::AcceptDragDropPayload("scene_entity_objectP");
if (payload)
{
const auto data = (DragDropData*)payload->Data;
if (std::string_view(data->Type) == "Mesh")
{
auto entity = m_EditorScene->CreateEntity(data->Name);
entity.AddComponent<MeshComponent>(Ref<Mesh>::Create(data->SourcePath));
}
}
ImGui::EndDragDropTarget();
}
/* Payload Implementation For Getting Assets In The Viewport From Asset Manager */
if (ImGui::BeginDragDropTarget())
{
auto payload = ImGui::AcceptDragDropPayload("scene_entity_assetsP");
if (payload)
{
auto data = (DragDropData*)payload->Data;
if (std::string_view(data->Type) == "PrismScene")
{
auto sceneName = data->SourcePath;
OpenScene(sceneName);
}
if (std::string_view(data->Type) == "Mesh")
{
auto entity = m_EditorScene->CreateEntity(data->Name);
entity.AddComponent<MeshComponent>(Ref<Mesh>::Create(data->SourcePath));
}
}
ImGui::EndDragDropTarget();
}
ImGui::End();
ImGui::PopStyleVar();
}