I have a school project - connect to MSSQL database, get some data for particular device, then in unity draw a graph, which will be bounded with some 3D object (devices in building etc.), I have time until December. It can be a desktop application or web application, or both. But I don’t know, if on some free web server I can use Unity3D and technologies which I am asking for.
I was looking through the Internet and I couldn’t find (even in Unity3D documentation), how it exactly works, I mean: on which technology Unity runs, which technologies it uses, or can be use. I find some sharps on forums, but you know…
I hope, there is a possibility how to to use in some way .NET to connect to MSSQL server… But I am looking for other ways, how to connect to database. I found SmartFoxServer and it looks great but maybe it is unnecessary? Some poeple recommended to write own socket, but I have no skills for do that in such a short time (and if I consider, that I have no clue how Unity works).
I am starting with Unity, so maybe someone know a good book about my questions. I found only game development, but nothing about Unity itself.
Unity’s webplayer is its own plugin, so the host you use doesn’t matter much, because the browser would run it. similar to how flash it does.
Regarding connecting to an database, you don’t want to connect directly to a db. The reason being, not every db connector uses managed code and the webplayer can only run managed code. A secondary reason is that you would have the db credentials in your application meaning that it would be very easy to hack unless you use the user system of the db, but most shared hosts are very limited in what they allow for user control. The normal way to solve this, is to build a webservice that will interact between the unity application and the database. This also allows you to do extra checks on the server side.
Unity provides a www class that you can use to access content on the web. With that you can access the webserver you are hosting your webservice on.
In short:
You need to have a host with a
database(this can be any free/cheap
host)
You need to write a website
that returns data(this can be in any
language that the host supports. Most
likely PHP in this case)
You need to
retrieve the data generated by the site using unity(unity has the WWW class for that)
Unity uses the MONO.NET framework, which is very similar to the Microsoft.NET framework.
All you need to do is google for how to connect to a SQL Server database with .NET and C# and the code will be the same in Unity.