Houston Unity Group Message Board › Unity with Mono

Unity with Mono

A former member
Post #: 16
I'm a bit confused as to how Mono works with Unity. I know that Mono is a substitute for the .NET Framework. What I'm wondering about is whether Mono somehow gets installed on a Mac, as a version of the .NET Framework would get installed on Windows, or is it automatically incorporated, along with its equivalent of the Common Language Runtime into any game built for the Mac? Is Mono even necessary if none of the scripts are in C#, or does Unity's version of JavaScript somehow use it as well? If in fact Unity JavaScript is drawing on Mono on non-Windows builds, does it somehow draw on the .Net Framework in a Windows build?
Robert B.
user 4548566
Houston, TX
Post #: 6
Sorry Hal... I replied back to your message earlier, but I don't see it.

Anyway, Mono is a new addition to Unity 3. Developers have been screaming for a debugger, and this is Unity's answer. U3 is still in beta, but will be out within the next month or so. They might be waiting until their conference in November...

Both Windows and Mac versions are available for download on the beta site. The install is a little whack, but it works. It is also capable of debugging JS and C#.
A former member
Post #: 17
I'm not sure what Mono provides for debugging, but Mono is certainly necessary for C# to work in non Windows OS. My guess is that Mono will get included in a Windows build as well, even at least for C# it is redundant.

Apparently Unity's version of JavaScript seems to run with Mono as well. It appears that Mono is just bundled with the build, and is a part of the Unity application executable as well.

It's probably better simply not to worry about it in the process of creating Unity scripts. Somehow JS and C# scripts work no matter what OS Unity is running on and what type of build is created in Unity. Up next in my work is to see just how much of the latest Mono is actually included. The Mono site claims that it now contains some .NET 3.5 stuff, including LINQ. If that it the case, and Unity's C# compiler is of a level to be able to compile LINQ code, Unity created games can include some really powerful functionality.
A former member
Post #: 20
A little experimentation answered a lot of questions. The short answer is that enough Mono, including the Mono version of the CLR and a couple of assembly DLL's, is included within Unity, and will be put into the build, to make basic things work with C#. If you want to do something exotic with C#, like access SQL Server, you have to add the appropriate Mono assembly, which is System.Data.dll. There is nothing i could find in the Unity documentation, and a lot of incorrect things in various posts on internet forums.

What you have to do is find the assembly, put a copy into into the Assets folder, and add a "using" clause in the C# script. In the Windows version, look for Mono assemblies in

C:\Program Files\Unity\Editor\Data\Frameworks\Mono.­Framework


I'm unable to find the Mono assemblies in the Mac version. Maybe it is better to just make Windows builds on a Windows version of Unity if you are thinking about adding more than the basic stuff.
Robert B.
user 4548566
Houston, TX
Post #: 9
In the back of my mind I have always been thinking about backend sorts of interfacing, such as the DB links you are mentioning about Mono. What I have seen so far is mostly a plugin approach. Someone out there will build a new tool which provides additional functionality to the engine and sells it for some price. Most of the tools are game focused.

But, I believe we will start to see more and more plugins focused on the usage of Unity (and other 3D engines) at the enterprise level for visualization exercises like you mentioned previously.

No longer will it take millions of dollars to put together your own 3D engine in order to have a virtual reality data room. Plus, the data room won't be restricted to a single location. The only one able to support it...

I would also add that native support C++ is on the horizon...
A former member
Post #: 21
We can make our own plugins with only a few lines of code. The proof of concept game I created accesses a SQL Server instance on my laptop and prints the results of the query on a GUI Label on the screen when the game starts. All that took was the creation of a SqlConnection object, a SqlCommand object, and a SqlDataReader object. About ten or so lines of code in a C# script put into one of the GameObjects.

What needs to be looked into are the following: (1) What functionality is currently possible with the Mono assemblies currently furnished with Unity; (2) What happens if I simply put a Mono assembly into the Assets folder even if that assembly isn't one of the ones furnished; (3) Suppose I try copying the corresponding assembly from .NET. Will that work; (4) Mono is said to be open source. That would open the possibility that Unity may have made some modifications to the Mono assemblies they furnish with Unity to make them work with Unity. If that is the case, just grabbing a Mono assembly and sticking it in the Assets folder and referencing it might not work.

At least in principle, we should be able to use all the trendy things that .NET programmers are obsessing about, including LINQ, WCF, .NET Remoting, or anything new that Microsoft comes up with.
Powered by mvnForum

Our Sponsors

People in this
Meetup are also in:

Sign up

Meetup members, Log in

By clicking "Sign up" or "Sign up using Facebook", you confirm that you accept our Terms of Service & Privacy Policy