To get tests to work, I had to create an Assets/Scripts/Scripts.asmdef and a Assets/Tests/Tests.asmdef The Tests depend on the Scripts, but not vice versa.
I believe because of this, every time I add a new library/plugin/etc. things get weird. I’ll use a current example: I tried to get Fungus installed (if you don’t know what that is, it’s probably not important). As soon as I did, I got an error in one of its classes saying TooltipAttribute.tooltip
doesn’t exist. I find that confusing because the documentation says it does, but my VS says that it has a .text instead. Whatever, I changed it, and now everything compiles, all my tests pass, yay.
Now, when I try to use Fungus, it gives me this error:
I found those classes here:
And I figure this means that Fungus is outside of Scripts.asmdef, so it’s like not accessible to the script code? My solution is to create an asmdef for Fungus and have Scripts.asmdef depend on it. I created the Fungus.asmdef here:
On closer inspection, it’s saying that all the stuff in Fungus/…/Editor needs to be in Assets/Editor. I’m very confused by this, because I thought the way Editor directories work is, they can be anywhere as long as they’re named Editor.
I took the whole Fungus/…/Editor directory and copied its contents into Assets/Editor.
That seems to have fixed everything. No more errors. BUT, I feel like all this manual work is very, very wrong. Can someone explain to me what’s going on and why I have to do these steps to get my project to work correctly?
I don’t know what’s going on so I may not have provided enough information for you guys/gals to help me. Just let me know. Here’s the inspector of all 3 asmdefs: