mirror of
https://github.com/Siccity/xNode.git
synced 2025-12-20 01:06:01 +08:00
reduces reload time from 400ms to 7ms in our project
probably very related to project size
This commit is contained in:
parent
5641110416
commit
c178040494
@ -153,6 +153,10 @@ namespace XNode {
|
||||
private static void BuildCache() {
|
||||
portDataCache = new PortDataCache();
|
||||
dynamicListPorts = new List<NodePort>();
|
||||
|
||||
#if UNITY_2019_2_OR_NEWER && UNITY_EDITOR
|
||||
List<System.Type> nodeTypes = UnityEditor.TypeCache.GetTypesDerivedFrom<Node>().Where(type => !type.IsAbstract).ToList();
|
||||
#else
|
||||
System.Type baseType = typeof(Node);
|
||||
List<System.Type> nodeTypes = new List<System.Type>();
|
||||
System.Reflection.Assembly[] assemblies = System.AppDomain.CurrentDomain.GetAssemblies();
|
||||
@ -177,6 +181,7 @@ namespace XNode {
|
||||
break;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
for (int i = 0; i < nodeTypes.Count; i++) {
|
||||
CachePorts(nodeTypes[i]);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user