Why does the following work to find classes that are using my custom attribute but,
Assembly [] assemblies = AppDomain.CurrentDomain.GetAssemblies();
foreach(Assembly a in assemblies)
{
foreach(Type t in a.GetTypes())
{
object [] attributes = t.GetCustomAttributes(typeof(TestingAttribute), false);
foreach(object o in attributes)
{
Debug.Log(o is TestingAttribute);
}
}
}
this method and similar ones I've found on StackOverflow do not. This code is executed in Unity3d. The result is empty.
Assembly [] assemblies = AppDomain.CurrentDomain.GetAssemblies();
foreach(Assembly a in assemblies)
{
var attributes = a
.GetCustomAttributes(typeof(TestingAttribute), false)
.Cast<TestingAttribute>();
foreach(TestingAttribute t in attributes)
{
Debug.Log(t);
}
}