forked from Misaki/GhostEngine
- Updated dependencies, including `Misaki.HighPerformance` and `TerraFX.Interop`. - Refactored `Result` struct for better error handling and chaining. - Removed `Ptr<T>` struct as it was no longer necessary. - Enhanced `Win32Utility` with `Attach` and `Dispose` methods. - Improved `ProjectService` and `AppStateMachine` with `Result` integration. - Refactored `IShaderCompiler` to support SPIR-V cross-compilation and pass-level compilation. - Standardized Direct3D12 resource management with `UniquePtr` and added `D3D12Object` base class. - Improved shader reflection validation and pipeline creation in `D3D12PipelineLibrary`. - Updated `SDLCompiler` for better error handling during shader generation. - Enhanced logging, debugging, and code readability across the codebase. - Performed general code cleanup, including unused namespace removal and naming consistency.
35 lines
1.0 KiB
C#
35 lines
1.0 KiB
C#
using Ghost.Data.Services;
|
|
|
|
namespace Ghost.Editor.Core.AssetHandle;
|
|
|
|
public static partial class AssetDatabase
|
|
{
|
|
private static FileSystemWatcher? _watcher;
|
|
|
|
private static readonly Dictionary<Guid, string> s_assetPathLookup = new();
|
|
|
|
public static DirectoryInfo? AssetsDirectory
|
|
{
|
|
get;
|
|
private set;
|
|
}
|
|
|
|
internal static void Initialize()
|
|
{
|
|
if (ProjectService.CurrentProject.Metadata == null)
|
|
{
|
|
throw new InvalidOperationException("Project metadata is not initialized. Ensure that the project is loaded before accessing the AssetDatabase.");
|
|
}
|
|
|
|
AssetsDirectory = new DirectoryInfo(Path.Combine(Path.GetDirectoryName(ProjectService.CurrentProject.Path)!, ProjectService.ASSETS_FOLDER));
|
|
_watcher = new FileSystemWatcher
|
|
{
|
|
Path = AssetsDirectory.FullName,
|
|
IncludeSubdirectories = true,
|
|
EnableRaisingEvents = true
|
|
};
|
|
|
|
InitializeAssetHandle();
|
|
InitializeMetaData();
|
|
}
|
|
} |