feat(editor): multi-script entities + asset browser panel
ScriptComponent now holds a list of {name, active} items (Unity
semantics: one entity, many scripts, each with its own enable bit;
component-level active stays as the master switch). ScriptRuntime
reconciles instances by name per entity -- rename/remove destroys
only the affected instances, untouched ones keep ticking. Scenes
persist Script.Items; old single-script key still loads.
AssetBrowserPanel (lightweight Unity Project window): fixed roots
(assets/scenes) as tabs, recursive directory tree, file list with
type filter (models/textures/scenes) and name substring filter,
double-click preloads models/HDRs into the asset caches (path-
deduped). Scene files point to the File menu for now; drag & drop
is a later iteration. Docked with Stats by default in fresh layouts.
This commit is contained in:
@@ -10,6 +10,7 @@
|
||||
//
|
||||
|
||||
#include "Editor.h"
|
||||
#include "AssetBrowserPanel.h"
|
||||
#include "HierarchyPanel.h"
|
||||
#include "InspectorPanel.h"
|
||||
#include "ViewportPanel.h"
|
||||
@@ -40,6 +41,7 @@ void Editor::Init(const EditorContext& ctx)
|
||||
m_Inspector = std::make_unique<InspectorPanel>();
|
||||
m_Viewport = std::make_unique<ViewportPanel>();
|
||||
m_Stats = std::make_unique<StatsPanel>();
|
||||
m_AssetBrowser = std::make_unique<AssetBrowserPanel>();
|
||||
}
|
||||
|
||||
void Editor::Draw()
|
||||
@@ -82,6 +84,7 @@ void Editor::Draw()
|
||||
}
|
||||
}
|
||||
if (m_ShowStats) m_Stats->Draw(m_Ctx);
|
||||
if (m_ShowAssetBrowser) m_AssetBrowser->Draw(m_Ctx);
|
||||
|
||||
DrawQuitModal();
|
||||
DrawSceneModals();
|
||||
@@ -154,6 +157,7 @@ void Editor::DrawMenuBar()
|
||||
ImGui::MenuItem("Inspector", nullptr, &m_ShowInspector);
|
||||
ImGui::MenuItem("Viewport", nullptr, &m_ShowViewport);
|
||||
ImGui::MenuItem("Stats", nullptr, &m_ShowStats);
|
||||
ImGui::MenuItem("Asset Browser", nullptr, &m_ShowAssetBrowser);
|
||||
ImGui::EndMenu();
|
||||
}
|
||||
|
||||
@@ -184,6 +188,7 @@ void Editor::DrawDockSpace()
|
||||
|
||||
ImGui::DockBuilderDockWindow("Hierarchy", dockLeft);
|
||||
ImGui::DockBuilderDockWindow("Stats", dockStats);
|
||||
ImGui::DockBuilderDockWindow("Asset Browser", dockStats);
|
||||
ImGui::DockBuilderDockWindow("Inspector", dockRight);
|
||||
ImGui::DockBuilderDockWindow("Viewport", dockCenter);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user