- Home /
Unexpected symbol CS1525
When using the code example from here:
http://msdn.microsoft.com/en-us/library/system.io.streamreader.readasync.aspx
I've written it as this:
But I'm getting this error from Unity (at the point with the red arrow) that I can't seem to resolve:
When I comment out the line it removes the error. I also tried to remove the cast but it did not resolve it.
Never seen await
used in a Unity script before. I'd guess that that is confusing the compiler.
Turns out strea$$anonymous$$g data smoothly in Unity is apparently not possible, which ruins the point of the game: http://answers.unity3d.com/questions/475296/how-can-i-asynchronously-load-and-save-text-files.html
Would still like to know the alternative to 'await' if it's not used from .NET.
Answer by Javy · Jul 15, 2013 at 01:45 PM
Unity doesn't support await (as of the time of the question) as answered by this question:
http://answers.unity3d.com/questions/493147/await-creates-error-with-streamreader.html
Answer by RomanorumLegio · Jun 16, 2013 at 08:18 PM
I'm not very skilled myself, but looking at the error message, the parenthesis is not your problem. The error says that the compiler is expecting the symbol `.' or , (most likely a comma). The compiler is probably expecting (int) to be a separate part of the phrase.