Unity 3's Mono Verison?

Well, what version is Mono in Unity 3? I remember hearing it got an upgrade. Is there going to be stuff like LINQ to Objects and automatic getters/setters?
Will the API be better updated to work with features like generics (i.e. can you PLEASE have a version of GetComponent<>() that returns null if if doesn’t find one?)

Just some questions from a C# addict :slight_smile:

The API did not really change but Mono is 2.6 now so yeah you can use anonymous objects and LINQ :slight_smile:

This is odd. I’m trying to use JSON.NET http://json.codeplex.com/ and i’ve run the dll through MoMA (mono migration analyzer) against Mono 2.6 and it says it’s a-ok, yet Unity3 is giving me the ReflectionTypeLoadException.

Unity uses mono 2.6 but it does not offer the full functionality. Different frameworks are cut as a matter of fact.

especially poised and broken is the iphone side where system.data is broken, reflection has never worked on 2.0 profile (not even on unity iphone 1.x) and various more things basically.

also the webplayer with its raised security targets etc has an own set of offered frameworks with an own target basically which you can’t impact at all.

from what I recall json.net does not faile due to reflection itself but because it tries to reflect something not present at all on the webplayer in U3 (anything that touches the security framework part for example will autofail)

This isn’t necessarily the answer to any specific problem, but worth mentioning here anyway… Unity 3 has an option in the player settings (menu: Edit > Project Settings > Player) called API Compatibility Level. By default, Unity will use a subset of the full Mono library, omitting the less commonly used sections to reduce the size of the built game. However, you can switch from the subset to full .NET 2.0 and get access to the whole library if you need it.

I guess one thing that’s really important to understand with Unity 3 is that while it supports a much more recent version of Mono, it also got more strict and especially on the Web player (and obviously on mobile devices) offers only limited functionality.

Question would be: Is there any way to find out what .NET APIs are available in which profile? In other words: Are the profiles Unity uses “official” profiles documented somewhere? If not, that would probably be a nice documentation project (unless I missed it in the existing documentation).

Actually I fear that this is rather incorrect andeeee

As shown in various threads there are different things that don’t work.
For example reflection has been broken since 1.7 with 2.0 targets but also since Unity 3, System.Data no longer works on the iphone among various other things (independent of the stripping level). I mention the system.data one cause it has lead to several threads and bug reports and has been a topic since beta not just release.

The webplayer is in an even worse state as the desire for security seems to have gone totally wild cutting base classes for many common usages that don’t impact the security and other things at all, simply due to no longer disabling single classes but whole namespaces if not whole assemblies, at least thats the clear impression I get from the errors I’ve been thrown at by the webplayer

in the state the mono reminder is at the time, its hard to call it “basing on mono” anymore cause the amount of mono things that are crippled, removed or just not working is larger than the opposite if we ignore system, system.xml and system.collections which are basically the only 3 things working fine normally.
To me it at the time makes it basically impossible to reasonably use U3 at all for any larger project cause using 3rd party .net code is at best russian roulette where as it should just work according the documentation, feature listing and your posting

Mono is gropwing… http://www.mono-project.com/news/archive/2010/Oct-06.html

You are quite right. What I should have said was that with the subset option turned off, you get the full library that is supplied with Unity. Certainly, there are parts of .NET that are non-functional in Unity for one reason or another.

It would be great if you guys could look into providing Definitions for MoMA (For 2.0 and 2.0 Subset), this makes things a lot easier to narrow down.

I’ve attached the Mono 2.8 (.NET 4.0) definition as an example. At least could you point me towards anything like a configuration file that details what switching between 2.0 and 2.0 Subset omits?

Also switching to 2.0 (from subset) “fixed” JSON.NET. To anyone else with similar problems: if switching to 2.0 doesn’t fix it, a common culprit is the dll trying to reference System.Web.

408122–14110–$2.8-4.0-defs.zip (580 KB)

I’m just middle of rewriting my SOAP utility and found this thread.
Could someone confirm if following are working in iPhone:

using System.Collections.Generic;
using System.IO;
using System.Text;
using System.Text.RegularExpressions;
using System.Xml;
using System.Xml.Serialization;

If not, I have to do message parsing manually and not with serialize/deserialize…

TIA, Juha

Unsure on regex, but the rest works.

With System.IO you just have to keep in mind that there is just 2 folders where you can write at all

Thanks Dreamora!

I there:
I finished a SOAP Server for php, my server auto generate the client code for Unity (c#) and it should work for iphone. It must be able to connect with visual studio and java web service as well.
I copy the auto generated code as a example:

so, i don’t think that you will need using System.Text.RegularExpressions;