Merge branch '1.5' into dotnet7

# Conflicts:
#	Source/Editor/Managed/ManagedEditor.Internal.cpp
#	Source/Engine/Core/Config/LayersAndTagsSettings.cs
This commit is contained in:
Wojtek Figat
2022-12-28 18:49:14 +01:00
97 changed files with 1945 additions and 421 deletions

View File

@@ -67,19 +67,21 @@ namespace FlaxEditor.CustomEditors
{
if (targetType.Type.GetArrayRank() != 1)
return new GenericEditor(); // Not-supported multidimensional array
// Allow using custom editor for array of custom type
var customEditorType = Internal_GetCustomEditor(targetType.Type);
if (customEditorType != null)
return (CustomEditor)Activator.CreateInstance(customEditorType);
return new ArrayEditor();
}
var targetTypeType = TypeUtils.GetType(targetType);
if (canUseRefPicker)
{
if (typeof(Asset).IsAssignableFrom(targetTypeType))
{
return new AssetRefEditor();
}
if (typeof(FlaxEngine.Object).IsAssignableFrom(targetTypeType))
{
return new FlaxObjectRefEditor();
}
}
// Use custom editor
@@ -87,11 +89,9 @@ namespace FlaxEditor.CustomEditors
var checkType = targetTypeType;
do
{
var type = Internal_GetCustomEditor(checkType);
if (type != null)
{
return (CustomEditor)Activator.CreateInstance(type);
}
var customEditorType = Internal_GetCustomEditor(checkType);
if (customEditorType != null)
return (CustomEditor)Activator.CreateInstance(customEditorType);
checkType = checkType.BaseType;
// Skip if cannot use ref editors
@@ -108,23 +108,17 @@ namespace FlaxEditor.CustomEditors
// Select default editor (based on type)
if (targetType.IsEnum)
{
return new EnumEditor();
}
if (targetType.IsGenericType)
if (targetType.IsGenericType)
{
if (targetTypeType.GetGenericTypeDefinition() == typeof(Dictionary<,>))
{
return new DictionaryEditor();
}
// Use custom editor
var genericTypeDefinition = targetType.GetGenericTypeDefinition();
var type = Internal_GetCustomEditor(genericTypeDefinition);
if (type != null)
{
return (CustomEditor)Activator.CreateInstance(type);
}
var customEditorType = Internal_GetCustomEditor(genericTypeDefinition);
if (customEditorType != null)
return (CustomEditor)Activator.CreateInstance(customEditorType);
}
// The most generic editor