Visual Studio not detecting built-in variable classes

Hyper

New member
I am trying to create a custom task which uses classes like SharedGameObject and SharedVector3. However upon doing so, Visual Studio does not recognise these classes.

1711730141751.png

Very confused as to why this is happening because I believe I have specified the correct namespace BehaviourDesigner.Runtime in order to use these classes. Also, looking at the built-in Seek script, I can see that the shared variable classes are being used without any problems.

1711730411865.png

How would I go about solving this issue?
 
Managed to find a fix for this but I don't know if it is desirable. Moved the Variables folder containing these classes from Behaviour Designer folder to somewhere within my own project folder. Visual Studio detects these classes and they can be used without any problems.
1711801102880.png
1711801108138.png
 
It looks like you are using assembly definitions, which means that you will need to reference Behavior Designer within that assembly definition in order for Unity to load the corresponding assembly. That's why moving the variables folder worked - you are moving the variables script into your own assembly definition.
 
Oh right. I don't see an assembly definition file for Behaviour Designer. Would I need to create one within the package folder, and then reference it within my relevant assembly definition?
 
You can get the assembly definition if you import the runtime source code, but within the assembly definition you can reference other dlls as well. Referencing the dll is the most straight forward approach.
 
Top