I found the problem in last versions of NodeCanvas. To fix the allocations with Dynamic Variables, please open up BBParameter.cs script and change the property ‘varRef’ at line #130 to this:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
publicVariablevarRef{
get{return_varRef;}
set
{
if(_varRef!=value){
#if UNITY_EDITOR //this avoids lots of allocations when using Dynamic Variables
if(!Application.isPlaying){
if(_varRef!=null){
_varRef.onNameChanged-=OnRefNameChanged;//remove old one
}
if(value!=null){
value.onNameChanged+=OnRefNameChanged;//add new one
OnRefNameChanged(value.name);//update name immediately
}
targetVariableID=value!=null?value.ID:null;
}
#endif
_varRef=value;
Bind(value);
}
}
}
Then just a few lines later, please also change property ‘bb’ to this:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
///The blackboard to read/write from. Setting this also sets the variable reference if found
publicIBlackboardbb{
get{return_bb;}
set
{
if(_bb!=value){
#if UNITY_EDITOR //avoid when using Dyanmic Variables