I upgraded to the latest version of NodeCanvas today, and have noticed that the AgentType attribute no longer works. My code no longer knows what the AgentType attribute is which leaves me to think it was removed from NodeCanvas. Is this true?
The [AgentType] attribute (which was only required for interface types) is indeed removed in v2.7. That is because it is now possible to use the generic version of tasks for specifying an interface type too.
So for example, this task:
1
2
3
4
5
6
[AgentType(typeof(IMyInterface))]
publicclassMyTask:ActionTask{
}
Now becomes:
1
2
3
4
5
publicclassMyTask:ActionTask<IMyInterface>{
}
The main benefit is that the ‘.agent’ property will now already be an IMyInterface type and no longer requires casting.
Yes I did work out that you can use the generic version of ActionTask to give the same behavior as you have a little note under the AgentType section in your documentation on task attributes.
Can you please ensure you record changes like this in your changelog, so that we have some notice when you delete pieces of code that have been in existence for a while that may break our projects? At least update the AgentType section in the documentation. I wasted over an hour thinking that NodeCanvas had not imported into the project properly, or there was a corrupt file somewhere.