Update editor

This commit is contained in:
2026-02-03 21:49:14 +09:00
parent 9fcf06dbe4
commit 59991f47d5
88 changed files with 1157 additions and 1288 deletions

View File

@@ -1,6 +1,5 @@
using CommunityToolkit.Mvvm.ComponentModel;
using Ghost.Editor.Core.Contracts;
using Ghost.Editor.Core.Inspector;
namespace Ghost.Editor.ViewModels.Pages.EngineEditor;
@@ -16,7 +15,7 @@ internal partial class InspectorViewModel(IInspectorService inspectorService) :
public void OnNavigatedTo(object? parameter)
{
inspectorService.OnSelectionChanged += OnSelectionChanged;
Inspectable = inspectorService.SelectedInspectable;
Inspectable = inspectorService.Selected;
}
public void OnNavigatedFrom()
@@ -25,8 +24,8 @@ internal partial class InspectorViewModel(IInspectorService inspectorService) :
Inspectable = null;
}
private void OnSelectionChanged()
private void OnSelectionChanged(object? sender, EventArgs e)
{
Inspectable = inspectorService.SelectedInspectable;
Inspectable = inspectorService.Selected;
}
}

View File

@@ -1,5 +1,5 @@
using CommunityToolkit.Mvvm.ComponentModel;
using Ghost.Data.Services;
using Ghost.Editor.Core;
using Ghost.Editor.Core.AssetHandle;
using Ghost.Editor.Models;
using System.Collections.ObjectModel;
@@ -36,12 +36,7 @@ internal partial class ProjectViewModel : ObservableObject
public ProjectViewModel()
{
if (ProjectService.CurrentProject.Metadata == null)
{
throw new InvalidOperationException("Current project is not set.");
}
var assetsRootItem = new ExplorerItem("Assets", Path.Combine(Path.GetDirectoryName(ProjectService.CurrentProject.Path)!, ProjectService.ASSETS_FOLDER), true);
var assetsRootItem = new ExplorerItem("Assets", Path.Combine(EditorApplication.CurrentProjectPath, EditorApplication.ASSETS_FOLDER_NAME), true);
LoadSubFolderRecursive(ref assetsRootItem);
SubDirectories.Add(assetsRootItem);