- Home /
Unity 3.0 Webplayer Editor Restrictions vs Webplayer Build Restrictions
Hi,
I'm working on a web-based application and have noticed some strange errors happening when I run a webplayer build. I have developed my application and tested thoroughly in the Unity Editor under the webplayer emulation mode. I've been able to iron out crossdomain errors and so forth thanks to the emulation mode which is great.
The problem that I'm running into is that I retrieve a static piece of JSON from my webserver. In the editor (again running webplayer emulation), I am able to deserialize this JSON into a predefined object of my library. However, when I deploy a webbuild, I've found that the deserialization process is failing due to the following error:
Attempt to access a private/protected method failed.
I'm using Json.NET as my serialization library (a very old version that is compatible with .NET 2.0). I did not have any problems with this when I was in Unity 2.6, but since I've upgraded I've hit this problem.
As I've said, I'm able to deserialize the JSON when running in webplayer mode emulation. Does this mean that there are further restrictions on the Mono/.NET frameworks in the actual WebPlayer build? My understanding was that the Webplayer emulation used the same restricted environment as the Webplayer build itself.
Any further help or information would be greatly appreciated!
Thanks so much for your time.
I am getting the same problem. I have reported the error, it is case 412029.
The problem, as you indicate, is that the sandbox is preventing access to private members, yet that is how serialization is normally implemented. $$anonymous$$y specific case is with the serialization of System.Random, which cannot be serialized by accessing its public API, as far as I can see.
Your answer
Follow this Question
Related Questions
A node in a childnode? 1 Answer
Unity 3.1 Webplayer: access method failed 1 Answer
websockets in webplayer 0 Answers
Serialization of Game State Into Web Server 0 Answers
Possibility of adding animation files during runtime? 1 Answer