I’m building a first-person GIS/ecology simulator, and projects like GDAL and dotSpatial already have tons of geospatial file handling functionality baked in. dotSpatial is .Net 4 native, is that a no-go with Unity’s old version of C#? Or are Mono and C# wholly different animals? Ideally I could process (build) dotSpatial into a suite of C# scripts and just drop them into my project but it is never ever that easy.
Very much hoping to avoid the huge hassle of requiring users to install external FOSS libraries just to run my fancy program.
Thank you for any guidance you can give.
Well, as far as I can see there are two ways of approaching this.
- Try just copy the sources into the project folder, launch Unity and see what happens. Start fixing obvious compile errors for half an hour or so to get a feeling how much work it would be to get everything running. This is the way to go if you plan to heavily alter and adjust the codebase anyway.
- If that fails, compile the source with your favorite C# compiler to a .net dll and copy that dll into the project folder. Again, launch Unity and see what happens. Now start fixing the import errors. If you run Visual Studio, Be sure to have the “Unity Tools for Visual Studio” installed set the compile target framework to “Unity 3.5 .net Subset Base Class Libraries”.
The first approach has the advantage that its easier to interfere with your other scripts and Unity features from the external dotSpatial project. So if you plan to modify the external project anyway to mold it into your needs, this is a lot less stress in the long run.
The second approach most definitely has a lot less errors to fix and hacks to add. Also, if you plan to not modify the external lib, then you should do this, so updating the library later is less work. Its also faster to compile in Unity Editor.
If someone is stil looking for this. I found a .net 2 library here:
Throw it in Assets/Plugins and it should be good to go