I’ve got a new problem I don’t know how to solve. I’m not entirely sure what it’s trying to do behind the scenes, and I don’t know where Visual Studio thinks the folders are.
I’m trying to add an “Editor” folder under another folder under Assets to store a script. If I create the folder and script through Unity and launch into the script, it loads Visual Studio but the folder nor file are listed in the solution. So I decided to try it the other way around, closed the script, deleted it and the folder from Unity, and then tried to add the folder from Visual Studio. But trying to do it that way, Visual Studio gives error “Cannot add a link to the folder Editor. There is already a file of the same name in this folder.”
So it says it’s there. But if I look under Assets in just a File Browser window, it’s not there. Where is Visual Studio trying to link to? How do I fix this?
Related to that, how can I best avoid this in the future when I’m adding C# classes to the project? Should I always add them through Unity? It seems that fails sometimes. And I often just want to add some generic class, and it seems the only way to do it is add a MonoBehavior script and then just convert it into something else in Visual Studio. Should I always add them through Visual Studio? So far this seems to work, but I don’t know if this can maybe confuse Unity.