Add support for pasting hex color values into Color properties in Editor

This commit is contained in:
Wojtek Figat
2021-09-23 13:27:08 +02:00
parent 257f57f926
commit ef78d9e9ed

View File

@@ -619,6 +619,13 @@ namespace FlaxEditor.CustomEditors
JsonSerializer.ParseID(text, out var id);
obj = FlaxEngine.Object.Find<FlaxEngine.Object>(ref id);
}
else if (Color.TryParseHex(text, out var color))
{
// Hex color
obj = color;
if (Values.Type.Type == typeof(Color32))
obj = (Color32)color;
}
else
{
// Default