Hmm. Are you possibly using any third party plugins that force load all assets in your project? NodeCanvas does not by itself force deserialize asset graphs at all. You could disable Unity’s no domain reload in your “Project Settings/Editor/Enter Play Mode Settings”, even though it seems that something else is going on with your project judging from the profiler screenshot. Please also let me know what version of NodeCanvas are you using?
Sorry for the late response.
We create а big project with more than three thousand BehaviourTree assets.
For the pure test, I made that:
– create a new empty Unity project
– import NodeCanvas plugin
– import Editor Iteration Profiler plugin (https://forum.unity.com/threads/introducing-the-editor-iteration-profiler.908390/)
– create a new folder in Assets and add all our BT assets to it
– run empty sample scene
Then I saw this in the Profiler ( screens in attachments)
I do not use any third-party plugins, it simple empty unity project. The caller is Unity Enjime self! (you can see it in Stacktrace)
Why need to use ISerializationCallbackReceiver.OnAfterDeserialize() and ISerializationCallbackReceiver.OnBeforeSerialize() methods in NodeCanvas Graph?
Version of NodeCanvas is 3.2.5.
Disabling Unity’s no domain reload can not help us when we change code. When we change one cs class, we need wait reload domain with deserialization all graphs! It is awful!
I tried AssemblyReloadEvents.beforeAssemblyReload and AssemblyReloadEvents.afterAssemblyReload to prevent call serialization/deserialisation on all graphs, it extreamely decrease time for reload assemblies but after this there are some troubles with graph in editor and NullRef Exceptions. Is there possible way to do this?
@Gavalakis, I found the problem, it is in class NodeCanvas.Editor.GraphAssetPostProcessor.
This line: AssetTracker.BeginTrackingAssetsOfType(typeof(Graph)); after run Editor trigerred calls serialization/deserialisation for each graph in every Reload Domain!
When I commented it, time to Reload Domain decrease from 14 second to 2.5 seconds for my graphs set.