Fix missing selection type in CustomEditorPresenter

This commit is contained in:
Wojtek Figat
2021-03-19 17:15:18 +01:00
parent 29e06eb696
commit 7010c52af3
2 changed files with 13 additions and 1 deletions

View File

@@ -250,6 +250,7 @@ namespace FlaxEditor.CustomEditors
Selection.Clear();
Selection.Add(obj);
Selection.SetType(new ScriptType(obj.GetType()));
OnSelectionChanged();
}
@@ -271,6 +272,7 @@ namespace FlaxEditor.CustomEditors
Selection.Clear();
Selection.AddRange(objectsArray);
Selection.SetType(new ScriptType(objectsArray.GetType()));
OnSelectionChanged();
}
@@ -284,6 +286,7 @@ namespace FlaxEditor.CustomEditors
return;
Selection.Clear();
Selection.SetType(ScriptType.Null);
OnSelectionChanged();
}

View File

@@ -43,7 +43,7 @@ namespace FlaxEditor.CustomEditors
/// <summary>
/// Gets the values type.
/// </summary>
public ScriptType Type { get; }
public ScriptType Type { get; private set; }
/// <summary>
/// Gets a value indicating whether single object is selected.
@@ -284,6 +284,15 @@ namespace FlaxEditor.CustomEditors
Type = type;
}
/// <summary>
/// Sets the type. Use with caution.
/// </summary>
/// <param name="type">The type.</param>
public void SetType(ScriptType type)
{
Type = type;
}
/// <summary>
/// Gets the custom attributes defined for the values source member.
/// </summary>