Add a way to reset an IBrush to null for default functionality.

This commit is contained in:
Chandler Cox
2023-08-30 18:09:59 -05:00
parent bd750d2634
commit 53fd158f2d
2 changed files with 4 additions and 1 deletions

View File

@@ -16,6 +16,7 @@ namespace FlaxEditor.CustomEditors.Editors
/// <inheritdoc /> /// <inheritdoc />
protected override OptionType[] Options => new[] protected override OptionType[] Options => new[]
{ {
new OptionType("null", null),
new OptionType("Texture", typeof(TextureBrush)), new OptionType("Texture", typeof(TextureBrush)),
new OptionType("Sprite", typeof(SpriteBrush)), new OptionType("Sprite", typeof(SpriteBrush)),
new OptionType("GPU Texture", typeof(GPUTextureBrush)), new OptionType("GPU Texture", typeof(GPUTextureBrush)),

View File

@@ -158,7 +158,9 @@ namespace FlaxEditor.CustomEditors.Editors
if (comboBox.SelectedIndex != -1) if (comboBox.SelectedIndex != -1)
{ {
var option = _options[comboBox.SelectedIndex]; var option = _options[comboBox.SelectedIndex];
value = option.Creator(option.Type); if (option.Type != null)
value = option.Creator(option.Type);
} }
SetValue(value); SetValue(value);
RebuildLayoutOnRefresh(); RebuildLayoutOnRefresh();