Files
GhostEngine/src/Editor/Ghost.Editor/Models/ExplorerItem.cs
Misaki bb07644580 Refactor asset streaming & resource management system
- Introduce Ghost.Engine.Streaming namespace and split asset entry logic into type-specific classes (TextureAssetEntry, MeshAssetEntry, SceneAssetEntry)
- Make AssetEntry abstract; add AssetEntryFactory for type dispatch
- Update AssetManager and ResourceStreamingProcessor for new entry model, supporting uploadable and processable assets
- Redesign scene/mesh asset loading, serialization, and binary formats with versioning (SceneContentHeader, MeshContentHeader)
- Move SceneLoadingType to Ghost.Engine and make public
- Inline performance-critical APIs with MethodImplOptions.AggressiveInlining
- Add deep cloning and improved resource management for Mesh and meshlet data
- Allow nullable log messages in Logger
- Update Misaki.HighPerformance package references
- Remove obsolete files (Asset.cs, ActivationHandler.cs, old mesh logic)
- Improve resource release logic in ResourceManager
- Update RenderContext and ResourceStreamingContext for new streaming model
- Add UnsafeArray/UnsafeList clone utilities
- Update scene serialization/deserialization for new format
- Update tests for new APIs, asset states, and formats
2026-05-12 22:51:51 +09:00

71 lines
1.5 KiB
C#

using CommunityToolkit.Mvvm.ComponentModel;
using Ghost.Engine.Streaming;
using System.Collections.ObjectModel;
namespace Ghost.Editor.Models;
internal partial class ExplorerItem : ObservableObject
{
public string Name
{
get;
}
public string Path
{
get;
}
public bool IsDirectory
{
get;
}
public AssetType AssetType
{
get;
}
[ObservableProperty]
public partial ObservableCollection<ExplorerItem>? Children
{
get; set;
}
[ObservableProperty]
public partial string IconGlyph
{
get; set;
}
public ExplorerItem(string name, string path, bool isDirectory, AssetType assetType = AssetType.Unknown)
{
Name = name;
Path = path;
IsDirectory = isDirectory;
AssetType = assetType;
if (IsDirectory)
{
IconGlyph = "\uE8B7"; // Folder icon
}
else
{
IconGlyph = GetIconGlyphForAssetType(assetType);
}
}
private string GetIconGlyphForAssetType(AssetType assetType)
{
return assetType switch
{
AssetType.Texture => "\uEB9F", // Image icon
AssetType.Material => "\uE943", // Document/Material
AssetType.Shader => "\uE9E9", // Code
AssetType.Mesh => "\uE8B3", // 3D icon
AssetType.Audio => "\uE8D6", // Audio
_ => "\uE7C3" // Default file icon
};
}
}