diff --git a/Source/Editor/CustomEditors/Editors/DoubleEditor.cs b/Source/Editor/CustomEditors/Editors/DoubleEditor.cs index 06dee3d1b..859b70f4e 100644 --- a/Source/Editor/CustomEditors/Editors/DoubleEditor.cs +++ b/Source/Editor/CustomEditors/Editors/DoubleEditor.cs @@ -1,5 +1,6 @@ // Copyright (c) 2012-2022 Wojciech Figat. All rights reserved. +using System; using System.Linq; using FlaxEditor.CustomEditors.Elements; using FlaxEngine; @@ -66,7 +67,13 @@ namespace FlaxEditor.CustomEditors.Editors } else { - _element.Value = (double)Values[0]; + var value = Values[0]; + if (value is double asDouble) + _element.Value = (float)asDouble; + else if (value is float asFloat) + _element.Value = asFloat; + else + throw new Exception(string.Format("Invalid value type {0}.", value?.GetType().ToString() ?? "")); } } }