mirror of
https://github.com/Siccity/xNode.git
synced 2026-03-26 22:49:02 +08:00
NodeEditorReflection: Catch ReflectionTypeLoadException
Can happen if dll can not be loaded for some reason
This commit is contained in:
parent
8adc4fd459
commit
8ae30f6622
@ -75,7 +75,13 @@ namespace XNodeEditor {
|
||||
List<System.Type> types = new List<System.Type>();
|
||||
System.Reflection.Assembly[] assemblies = System.AppDomain.CurrentDomain.GetAssemblies();
|
||||
foreach (Assembly assembly in assemblies) {
|
||||
types.AddRange(assembly.GetTypes().Where(t => !t.IsAbstract && baseType.IsAssignableFrom(t)).ToArray());
|
||||
#if UNITY_EDITOR
|
||||
try {
|
||||
#endif
|
||||
types.AddRange(assembly.GetTypes().Where(t => !t.IsAbstract && baseType.IsAssignableFrom(t)).ToArray());
|
||||
#if UNITY_EDITOR
|
||||
} catch(ReflectionTypeLoadException) {}
|
||||
#endif
|
||||
}
|
||||
return types.ToArray();
|
||||
}
|
||||
@ -162,4 +168,4 @@ namespace XNodeEditor {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user