For get culture Info in Unity3d app I wrote some code:
public static System.Globalization.CultureInfo GetCultureInfo()
{
if (cultureInfo == null)
cultureInfo = System.Globalization.CultureInfo
.CreateSpecificCulture(Localization.Data.Locale);
return cultureInfo;
}
It's works fine when i run app in Editor. If I built app as web and run then i recieve exception
at System.Security.SecurityManager.ThrowException (System.Exception ex)
[0x00000] in <filename unknown>:0
Why it does not work in web player?
If you look into the method CultureInfo.CreateSpecificCulture() in the mscorlib used by the WebPlayer (using ILSpy for instance) you'll see that it is marked as SecurityCritical (you can read more information about .Net security here and here)
[SecurityCritical]
public static CultureInfo CreateSpecificCulture(string name)
and, AFAIK, all code from your game is considered to be "transparent" so it is not allowed to call into "security critical" code.
Also, if you check this page the method is marked as not supported on WebPlayer.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With