Start of material editor

This commit is contained in:
Simon Lübeß
2025-03-03 20:29:35 +01:00
parent 10e8b3c282
commit 6d50208700
12 changed files with 304 additions and 370 deletions
@@ -504,7 +504,7 @@ namespace GlitchyEditor.EditWindows
ShowAssetDropTarget<Material>(ref spriteRendererComponent.Material);
}
private static bool ShowAssetDropTarget(ref AssetHandle target)
public static bool ShowAssetDropTarget(ref AssetHandle target)
{
bool changed = false;
@@ -539,8 +539,10 @@ namespace GlitchyEditor.EditWindows
return changed;
}
private static void ShowAssetDropTarget<T>(ref AssetHandle<T> target) where T : Asset
public static bool ShowAssetDropTarget<T>(ref AssetHandle<T> target) where T : Asset
{
bool changed = false;
T currentAsset = target.Get();
StringView identifier = (target.IsValid ? "<Missing Asset>" : "None");
@@ -565,10 +567,13 @@ namespace GlitchyEditor.EditWindows
// TODO: Somehow validate the type, please!
target = (AssetHandle<T>)Content.LoadAsset(path);
changed = true;
}
ImGui.EndDragDropTarget();
}
return changed;
}
private static void ShowCircleRendererComponentEditor(Entity entity, CircleRendererComponent* circleRendererComponent)