using System; using System.Collections.Generic; using UnityEngine; namespace GameplayIngredients { public static class TypeUtility { public static Type[] GetConcreteTypes() { List types = new List(); foreach (var assembly in AppDomain.CurrentDomain.GetAssemblies()) { Type[] assemblyTypes = null; try { assemblyTypes = assembly.GetTypes(); } catch { Debug.LogError($"Could not load types from assembly : {assembly.FullName}"); } if (assemblyTypes != null) { foreach (Type t in assemblyTypes) { if (typeof(T).IsAssignableFrom(t) && !t.IsAbstract) { types.Add(t); } } } } return types.ToArray(); } } }