mirror of
https://github.com/aharabada/glitchy-engine-beef.git
synced 2026-09-05 21:01:52 +00:00
Allow changing Effect of Materials
+ TextureDimension Property for Texture
This commit is contained in:
@@ -59,9 +59,38 @@ class MaterialAssetPropertiesEditor : AssetPropertiesEditor
|
||||
|
||||
if (material == null)
|
||||
return;
|
||||
|
||||
ImGui.TextUnformatted("Effect: ");
|
||||
ImGui.SameLine();
|
||||
|
||||
Effect effect = material?.Effect;
|
||||
|
||||
StringView effectName = (effect?.Identifier ?? "(None)");
|
||||
|
||||
ImGui.Button(effectName.ToScopeCStr!());
|
||||
|
||||
ImGui.AttachTooltip(effectName);
|
||||
|
||||
// Effect drop target
|
||||
if (ImGui.BeginDragDropTarget())
|
||||
{
|
||||
ImGui.Payload* payload = ImGui.AcceptDragDropPayload(.ContentBrowserItem);
|
||||
|
||||
if (payload != null)
|
||||
{
|
||||
StringView path = .((char8*)payload.Data, (int)payload.DataSize);
|
||||
|
||||
AssetHandle<Effect> newEffect = Content.LoadAsset(path);
|
||||
|
||||
material.Effect = newEffect;
|
||||
|
||||
//newTexture.Get().SamplerState = SamplerStateManager.AnisotropicWrap;
|
||||
//material.SetTexture(texture.key, newTexture.Cast<Texture>());
|
||||
}
|
||||
|
||||
ImGui.EndDragDropTarget();
|
||||
}
|
||||
|
||||
if (effect == null)
|
||||
return;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user