Firstborn/Assets/AwesomeTechnologies/VegetationStudioPro/Runtime/Utility/Extentions/ReflectionExtentions.cs
Schaken-Mods 959e80cf72 assets upload
assets upload description.
2023-03-28 12:16:30 -05:00

25 lines
491 B
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
namespace AwesomeTechnologies.Extensions
{
public static class ReflectionExtentions
{
public static IEnumerable<Type> GetLoadableTypes(this Assembly assembly)
{
if (assembly == null) throw new ArgumentNullException(nameof(assembly));
try
{
return assembly.GetTypes();
}
catch (ReflectionTypeLoadException e)
{
return e.Types.Where(t => t != null);
}
}
}
}