Add a way to reset an IBrush to null for default functionality.
This commit is contained in:
@@ -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)),
|
||||||
|
|||||||
@@ -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();
|
||||||
|
|||||||
Reference in New Issue
Block a user