Allow changing Effect of Materials

+ TextureDimension Property for Texture
This commit is contained in:
Simon Lübeß
2023-08-01 13:28:04 +02:00
parent 5d8c1b111a
commit e8a5594540
7 changed files with 142 additions and 27 deletions
@@ -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;
-1
View File
@@ -70,7 +70,6 @@ class ProjectUserSettings
public void RestoreDefaults()
{
//_lastOpenedScene?.Clear();
if (_recentScenes != null)
ClearAndDeleteItems!(_recentScenes);