From 7010c52af3fd22ed28896e86988698ff3b1947ea Mon Sep 17 00:00:00 2001 From: Wojtek Figat Date: Fri, 19 Mar 2021 17:15:18 +0100 Subject: [PATCH] Fix missing selection type in CustomEditorPresenter --- Source/Editor/CustomEditors/CustomEditorPresenter.cs | 3 +++ Source/Editor/CustomEditors/Values/ValueContainer.cs | 11 ++++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/Source/Editor/CustomEditors/CustomEditorPresenter.cs b/Source/Editor/CustomEditors/CustomEditorPresenter.cs index 2cea89f08..7f19de195 100644 --- a/Source/Editor/CustomEditors/CustomEditorPresenter.cs +++ b/Source/Editor/CustomEditors/CustomEditorPresenter.cs @@ -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(); } diff --git a/Source/Editor/CustomEditors/Values/ValueContainer.cs b/Source/Editor/CustomEditors/Values/ValueContainer.cs index 84542e591..49d3b5591 100644 --- a/Source/Editor/CustomEditors/Values/ValueContainer.cs +++ b/Source/Editor/CustomEditors/Values/ValueContainer.cs @@ -43,7 +43,7 @@ namespace FlaxEditor.CustomEditors /// /// Gets the values type. /// - public ScriptType Type { get; } + public ScriptType Type { get; private set; } /// /// Gets a value indicating whether single object is selected. @@ -284,6 +284,15 @@ namespace FlaxEditor.CustomEditors Type = type; } + /// + /// Sets the type. Use with caution. + /// + /// The type. + public void SetType(ScriptType type) + { + Type = type; + } + /// /// Gets the custom attributes defined for the values source member. ///