From b11fd24843794703f2c4271fe4f227151b2061f5 Mon Sep 17 00:00:00 2001 From: Barnaby Smith Date: Sat, 6 Apr 2013 15:06:32 +0100 Subject: [PATCH] Added support for Unity 4 Unity 3.x had an issue with the byte order mark at the start of XML files, which there was a code work around for. Unity 4 has subsequently fixed the issue, so the work around has been ifdef'd to work only on Unity 3.x. --- Assets/Scripts/XNAEmulator/Content/ContentManager.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Assets/Scripts/XNAEmulator/Content/ContentManager.cs b/Assets/Scripts/XNAEmulator/Content/ContentManager.cs index 9d762c0..151464a 100644 --- a/Assets/Scripts/XNAEmulator/Content/ContentManager.cs +++ b/Assets/Scripts/XNAEmulator/Content/ContentManager.cs @@ -88,7 +88,11 @@ namespace Microsoft.Xna.Framework.Content Dictionary fontSettings = new Dictionary(); StringReader stringReader = new StringReader(spriteFontText.text); - stringReader.Read(); // Skip the byte order mark - seems to cause Unity issues + +#if UNITY_3_0 || UNITY_3_0_0 || UNITY_3_1 || UNITY_3_2 || UNITY_3_3 || UNITY_3_4 || UNITY_3_5 + stringReader.Read(); // Skip the byte order mark on Unity 3.x - note that this seems to work as of Unity 4 +#endif + XmlTextReader xmlReader = new XmlTextReader(stringReader); XmlDocument document = new XmlDocument();