From e2fca85636ef5c029043410fb336263faf72d009 Mon Sep 17 00:00:00 2001 From: Mikhail <99481254+DCFApixels@users.noreply.github.com> Date: Tue, 1 Oct 2024 19:05:51 +0800 Subject: [PATCH] fix --- src/Internal/Editor/UnityEditorUtility.cs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/Internal/Editor/UnityEditorUtility.cs b/src/Internal/Editor/UnityEditorUtility.cs index e78df8a..848c40e 100644 --- a/src/Internal/Editor/UnityEditorUtility.cs +++ b/src/Internal/Editor/UnityEditorUtility.cs @@ -102,6 +102,7 @@ namespace DCFApixels.DragonECS.Unity.Editors #if UNITY_EDITOR namespace DCFApixels.DragonECS.Unity.Editors { + using System.Reflection; using UnityEditor; [InitializeOnLoad] @@ -114,10 +115,15 @@ namespace DCFApixels.DragonECS.Unity.Editors List serializableTypes = new List(); foreach (var assembly in AppDomain.CurrentDomain.GetAssemblies()) { + //var targetTypes = assembly.GetTypes().Where(type => + // (type.IsGenericType || type.IsAbstract || type.IsInterface) == false && + // type.IsSubclassOf(typeof(UnityObject)) == false && + // type.GetCustomAttribute() != null); + var targetTypes = assembly.GetTypes().Where(type => (type.IsGenericType || type.IsAbstract || type.IsInterface) == false && type.IsSubclassOf(typeof(UnityObject)) == false && - /*type.GetCustomAttribute() != null*/ true); + type.GetConstructor(Type.EmptyTypes) != null); serializableTypes.AddRange(targetTypes); }