Web Player and System.IO.File

More
5 years 6 months ago - 5 years 6 months ago #84 by Kerozard
Hey Guys,

I bought I2 Localization a few days back and it made the transition from my HTML5 JS Game to a Unity3d C# Game so much easier. Good job!

Today I tried to create a Web Player Build of the game and got this error message:

Assets/I2/Localization/Scripts/LocalizationReader.cs(85,56): error CS0117: `System.IO.File' does not contain a definition for `ReadAllBytes'


The error seemed logical since the terms are stored in plain files and those can't be read in the web player. Hence you can't read from those files. So the question is: What am I missing. There should maybe be a way to convert all those terms into individual script files just like the text files that are created. Is there such a way? Am I doing something wrong?

Patrick

PS: The Buttons in this forum need a css change. light grey buttons with white text are almost impossible to read unless you hover over them. :-)
Last edit: 5 years 6 months ago by Kerozard.

Please Log in or Create an account to join the conversation.

More
5 years 6 months ago #85 by Frank
Replied by Frank on topic Web Player and System.IO.File
Hi,

Version (2.0.3) had a problem compiling to the Web Player.
Those issues are fixed in the latest version (2.1.0 b1) which was released a few days ago but its still in beta.

You can download the new version from the I2 Community as it could take a week for it to be approved into the asset store.
You can email me (This email address is being protected from spambots. You need JavaScript enabled to view it.) with the invoice number and I will add you to the Google Plus community.

Also, a quick fix for that compile error is to replace the function ReadCSVfile in the LocalizationReader.cs by this one:
		public static List<string[]> ReadCSVfile( string Path )
		{
			string Text = string.Empty;
			#if UNITY_WP8 && !UNITY_EDITOR
				byte[] buffer = UnityEngine.Windows.File.ReadAllBytes (Path);
				Text = Encoding.UTF8.GetString(buffer, 0, buffer.Length);
			#else
				using (System.IO.StreamReader reader = System.IO.File.OpenText(Path))
				{
					Text = reader.ReadToEnd();
				}
			#endif

			Text = Text.Replace("\r\n", "\n");

			return ReadCSV (Text);
		}

Ahh, thanks for pointing the button' color issue. I'll have to make a time to finish the site! :-)

Are you :-) Give I2L 5 stars!
Are you :-( Please lets us know how to improve it!
To get the betas as soon as they are ready, check this out
The following user(s) said Thank You: Kerozard

Please Log in or Create an account to join the conversation.

More
5 years 6 months ago #86 by Kerozard
That was fast. Thank you.

I also just sent you an email with the invoice number. And don't worry too much about those buttons. You have no idea how long I wanted to finish our corporate page. There ist just always something more pressing to do. :-)

Please Log in or Create an account to join the conversation.

Time to create page: 0.150 seconds
Template by JoomlaShine