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:
2026-10-04 00:43:06 +08:00
parent 74a2044441
commit ab7a43a686
9 changed files with 459 additions and 63 deletions
+3
View File
@@ -26,6 +26,7 @@ class HierarchyPanel;
class InspectorPanel;
class ViewportPanel;
class StatsPanel;
class AssetBrowserPanel;
class Editor {
public:
@@ -86,6 +87,7 @@ private:
std::unique_ptr<InspectorPanel> m_Inspector;
std::unique_ptr<ViewportPanel> m_Viewport;
std::unique_ptr<StatsPanel> m_Stats;
std::unique_ptr<AssetBrowserPanel> m_AssetBrowser;
entt::entity m_Selected{entt::null};
@@ -94,6 +96,7 @@ private:
bool m_ShowInspector = true;
bool m_ShowViewport = true;
bool m_ShowStats = true;
bool m_ShowAssetBrowser = true;
// 默认布局只建一次(imgui.ini 已有布局则跳过)
bool m_LayoutBuilt = false;