|
|
|
|
|
|
List<Type> types = new List<Type>(); |
|
|
|
foreach(var assembly in AppDomain.CurrentDomain.GetAssemblies()) |
|
|
|
{ |
|
|
|
foreach(Type t in assembly.GetTypes()) |
|
|
|
Type[] assemblyTypes = null; |
|
|
|
|
|
|
|
try |
|
|
|
{ |
|
|
|
assemblyTypes = assembly.GetTypes(); |
|
|
|
} |
|
|
|
catch |
|
|
|
{ |
|
|
|
Debug.LogError($"Could not load types from assembly : {assembly.FullName}"); |
|
|
|
} |
|
|
|
|
|
|
|
if(assemblyTypes != null) |
|
|
|
if(typeof(Manager).IsAssignableFrom(t) && !t.IsAbstract) |
|
|
|
foreach (Type t in assemblyTypes) |
|
|
|
types.Add(t); |
|
|
|
} |
|
|
|
if (typeof(Manager).IsAssignableFrom(t) && !t.IsAbstract) |
|
|
|
{ |
|
|
|
types.Add(t); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
return types.ToArray(); |
|
|
|
} |