I’ve just update to version 3 and come into some problems. Previously I had put in a couple of small tweaks that referenced my own code from within the Node Canvas code. However, since updating I can no longer do that. This seems to be because the Paradox Notion code is in its own project within the solution now and it can’t see that other code.
Do you either know of how I can get it to see my code or perhaps if it’s possible for me to move it back into the main project?
Indeed. NodeCanvas v3 comes within a Unity “Assembly Definition”. That is the “ParadoxNotion.asmdef” file that exists on the root “ParadoxNotion” folder. This has some nice advantages, but as you found out, one (probably the only) disadvantage of using Assembly Definitions, is that code inside that assembly definition can not access code outside that assembly definition (although the reverse is possible). https://docs.unity3d.com/Manual/ScriptCompilationAssemblyDefinitionFiles.html
If you simply delete the ParadoxNotion.asmdef file, there will be compilation errors however due to some methods, properties, etc having an “internal” access modifiers in NodeCanvas, which is done so that the API is cleaner. I could change these modifiers to public once again, but I would really prefer not to if there is another way to achieve what you are after 🙂
Having said that, can you please let me know what kind of tweaks you’ve done? Maybe there is another way of doing what you need?
Basically, the biggest change was that I had changed the way the text was displayed in the dialogue tree nodes so that it could use a custom inspector to handle localization. We’ve got a lot of dialogue already plugged into this system so I wanted to avoid having to extend the nodes externally and convert them all over.
It’s basically one function call that I need to access. Is there perhaps something I could do, that could act as a bridge between the two projects and let ParadoxNotion talk to some parts of my code?
Hmm. If it is only one function call one solution (while keeping the way things are now with asmdef) would be to use reflection to call that method. It’s definitely not the best solution, but for one method call, it should be fine.
Another solution would probably be to move the nodes you have modified (and from which you make calls to your code) outside of the ParadoxNotion folder, but this is a bit messy.
A third solution would be to create an Assembly Definition for your code and reference one assembly to the other, but I don’t think it’s worth the effort doing that just for one method call.
Probably the first solution (using reflection) is best in this case.