Fix materials parameters display issues after editing

This commit is contained in:
Wojtek Figat
2021-08-18 22:55:31 +02:00
parent 540643972a
commit fff2c3e038
5 changed files with 43 additions and 31 deletions

View File

@@ -604,7 +604,7 @@ namespace FlaxEditor.Surface
Parent = this
};
Presenter = new CustomEditorPresenter(undo);
Presenter = new CustomEditorPresenter(undo, "Loading...");
Presenter.Panel.Parent = scrollPanel;
}
@@ -744,7 +744,7 @@ namespace FlaxEditor.Surface
}
else
{
_propertiesEditor = new CustomEditorPresenter(_undo);
_propertiesEditor = new CustomEditorPresenter(_undo, "Loading...");
_propertiesEditor.Panel.Parent = _split2.Panel2;
}
_propertiesEditor.Modified += OnPropertyEdited;
@@ -896,6 +896,16 @@ namespace FlaxEditor.Surface
Close();
}
/// <summary>
/// Called when surface gets loaded and user can edit it.
/// </summary>
protected virtual void OnSurfaceEditingStart()
{
_undo.Clear();
_surface.Enabled = true;
_propertiesEditor.BuildLayout();
}
/// <summary>
/// Loads the surface from the asset. Called during <see cref="Update"/> when asset is loaded and surface is missing.
/// </summary>
@@ -939,10 +949,7 @@ namespace FlaxEditor.Surface
return;
}
// Setup
_undo.Clear();
_surface.Enabled = true;
_propertiesEditor.BuildLayout();
OnSurfaceEditingStart();
ClearEditedFlag();
if (_showWholeGraphOnLoad)
{