Fix log spam from TypeEditor if type is missing
This commit is contained in:
@@ -464,6 +464,11 @@ namespace FlaxEditor.CustomEditors.Editors
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public class TypeNameEditor : TypeEditorBase
|
public class TypeNameEditor : TypeEditorBase
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Prevents spamming log if Value contains missing type to skip research in subsequential Refresh ticks.
|
||||||
|
/// </summary>
|
||||||
|
private string _lastTypeNameError;
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public override void Initialize(LayoutElementsContainer layout)
|
public override void Initialize(LayoutElementsContainer layout)
|
||||||
{
|
{
|
||||||
@@ -484,8 +489,13 @@ namespace FlaxEditor.CustomEditors.Editors
|
|||||||
{
|
{
|
||||||
base.Refresh();
|
base.Refresh();
|
||||||
|
|
||||||
if (!HasDifferentValues && Values[0] is string asTypename)
|
if (!HasDifferentValues && Values[0] is string asTypename &&
|
||||||
|
!string.Equals(asTypename, _lastTypeNameError, StringComparison.Ordinal))
|
||||||
|
{
|
||||||
_element.CustomControl.Value = TypeUtils.GetType(asTypename);
|
_element.CustomControl.Value = TypeUtils.GetType(asTypename);
|
||||||
|
if (_element.CustomControl.Value == null && asTypename.Length != 0)
|
||||||
|
_lastTypeNameError = asTypename;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user