diff --git a/Assets/Plugins/ScriptableObjectFactory/Editor/ScriptableObjectFactory.cs b/Assets/Plugins/ScriptableObjectFactory/Editor/ScriptableObjectFactory.cs index 3408eaf..89748ac 100644 --- a/Assets/Plugins/ScriptableObjectFactory/Editor/ScriptableObjectFactory.cs +++ b/Assets/Plugins/ScriptableObjectFactory/Editor/ScriptableObjectFactory.cs @@ -18,21 +18,22 @@ public static void CreateScriptableObjectFactoryWindow() public static void CreateScriptableObjectFactoryWindow(bool getAllAssemblies) { - List allScriptableObjectTypes; + var allScriptableObjectTypes = new List(); - try + var assemblies = getAllAssemblies ? GetAllAssemblies() : GetCSharpAssembly(); + foreach (var assembly in assemblies) { - var assemblies = getAllAssemblies ? GetAllAssemblies() : GetCSharpAssembly(); - - allScriptableObjectTypes = new List(from assembly in assemblies - from type in assembly.GetTypes() - where type.IsSubclassOf(typeof(ScriptableObject)) - select type); - } - catch (Exception e) - { - Debug.LogError("Error while opening scriptable object window: " + e.Message); - allScriptableObjectTypes = new List(); + try + { + allScriptableObjectTypes.AddRange(from type in assembly.GetTypes() + where type.IsSubclassOf(typeof(ScriptableObject)) + select type); + } + catch (Exception e) + { + Debug.LogError("Error while opening scriptable object window: " + + "assembly=" + assembly.FullName + "\n" + e.Message); + } } ScriptableObjectWindow.Init(allScriptableObjectTypes.ToArray(), getAllAssemblies);