We have a setup using 2 behaviour tree components with different group indices on the same enemy.
In this way tree 0 can run a new external tree that is set as the external tree for the tree in group 1. This new external tree is then executed.
We have set it up so that they share their blackboards. To share the variables we're using GetAllVariables on the Behaviors and running some code to migrate required variables into the second Behaviour Tree.
Profiling this code I noticed that every time GetAllVariables is called there is a GCAlloc is created from this.CheckForSerialization();.
Is their a safe non-alloc way to run something like this? Does the tree need to check for serialization every time GetAllVariables is called?
In this way tree 0 can run a new external tree that is set as the external tree for the tree in group 1. This new external tree is then executed.
We have set it up so that they share their blackboards. To share the variables we're using GetAllVariables on the Behaviors and running some code to migrate required variables into the second Behaviour Tree.
Profiling this code I noticed that every time GetAllVariables is called there is a GCAlloc is created from this.CheckForSerialization();.
Is their a safe non-alloc way to run something like this? Does the tree need to check for serialization every time GetAllVariables is called?