mirror of
https://github.com/aharabada/glitchy-engine-beef.git
synced 2026-09-05 21:01:52 +00:00
Universal AssetHandles. Serialize AssetHandle instead of AssetIdentifier
A bit unstable
This commit is contained in:
@@ -1064,7 +1064,7 @@ namespace GlitchyEditor.EditWindows
|
||||
|
||||
GeometryBinding mesh = meshComponent.Mesh;
|
||||
|
||||
StringView identifier = mesh?.Identifier ?? "None";
|
||||
StringView identifier = mesh?.Identifier ?? (meshComponent.Mesh.IsValid ? "<Missing Asset>" : "None");
|
||||
ImGui.Button(identifier.ToScopeCStr!());
|
||||
|
||||
if (ImGui.BeginDragDropTarget())
|
||||
|
||||
@@ -141,8 +141,18 @@ namespace GlitchyEditor.EditWindows
|
||||
|
||||
if (payload != null)
|
||||
{
|
||||
StringView path = .((char8*)payload.Data, (int)payload.DataSize);
|
||||
_editor.RequestOpenScene(this, path);
|
||||
StringView assetIdentifier = .((char8*)payload.Data, (int)payload.DataSize);
|
||||
|
||||
let treeNode = _editor.ContentManager.AssetHierarchy.GetNodeFromIdentifier(assetIdentifier);
|
||||
|
||||
if (treeNode case .Err)
|
||||
{
|
||||
Log.EngineLogger.Error($"Dragged Asset doesn't exist. {assetIdentifier}");
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
_editor.RequestOpenScene(this, treeNode->Value.Path);
|
||||
}
|
||||
|
||||
ImGui.EndDragDropTarget();
|
||||
|
||||
Reference in New Issue
Block a user