![]() ![]() I am loosing editor integration, but Im gaining peace of mind that unity wont blow up and corrupt my array of 100 items, levels, whatever." nventimiglia Expert 2 points 2 years ago. "This is why I am moving away from scriptable objects style services and into using static clr objects that load their configuration from csv / json txt files. So the idea of JSONUtility being layered on top of the system they were trying to get away from doesn't appeal to them. ![]() While this reddit discussion goes to the heart of the matter:įor many Unity developers, an important reason for using a JSON serialization library is to avoid using Unity's serialization system. Even worse than a wolf: it's layered directly on top of Unity's infamous serialization system, and inherits all its bizarre quirks and limitations, making it practically useless (and probably slow).įirst, in order to begin to understand how truly fucked up Unity's JSONUtility library truly is, you have to understand how truly fucked up Unity's serialization system is, and this great classic blog posting by Lucas Meijer bravely and honestly touches the surface, then falls off into the deep end: Unity now has its own JSONUtility module that at first glance seems like it might be useful, but once you try to actually use it for anything in the real or virtual world, you hit a wall, because it's a wolf in sheep's clothing. JSONObject on the Asset Store: !/content/710 (It doesn't correctly handle string escapes like \r \n \u1234 etc - c'mon, there's a very simple explicit JSON spec that defines every bit of the syntax: follow it!) It's not particularly efficient (in speed or runtime size), has a terrible API, few advanced features, and some embarrassing bugs. JSONObject is another free simple JSON library written for Unity, which I've been using for years, and while it works for basic stuff, I'm not very happy with it (which is why I'm looking around for alternatives). Thread asking about using FastJSON on Unity, where the FullSerializer author chimes in. So far, it seems like the best balanced compromise I've found between Unity's limitations and a full set of useful features, and it looks to me like well written but not overly complex code. ![]() Net 2.0 subset features, advanced reflection features, LINQ, code generation and even exceptions. That would sacrifice some of the optimizations and advanced features, but still might be worth doing.įull Serializer is a well written free JSON library with lots of useful features that is specifically designed for Unity from the start, which avoids using anything that will limit optimization, like anything higher than. I asked the author about it, and he said that its speed was the result of dynamic code generation features that Unity doesn't support. It hasn't been ported to Unity, but that might be worth doing, since it's such a nice piece of work. ![]() The free version doesn't run on Unity out of the box, but there is a striped down simplified version that runs on Unity available on the Unity Asset Store for $25.įastJSON is quite fast true to its name, free, has a lot of advanced features, is deeply customizable, is highly optimized and benchmarked against other libraries, and there's a great in-depth article comparing it to other libraries and explaining its optimization techniques. JSON.Net is one of the most advanced feature-rich C# JSON libraries, and it is free, but it is not the fastest. Some of those have been stripped down and ported to Unity, but others haven't. Some of the big fancy luxurious all dancing all singing JSON libraries intended for less restricted CLR platforms like Windows do all kinds of amazing tricks to reduce and optimize their use of reflection. So the question of "Why is reflection so slow?" is very interesting to me as a Unity iOS developer, since I'm forced to use it without all the fancy optimizations (or figure out how to avoid using it). And most importantly on AOT-compiled platforms like iOS and consoles, it doesn't support dynamic JIT compilation and interfaces like Reflection.Emit, which some of the high performance JSON serialization libraries use for optimization. It can also be optimized by disabling exceptions. Unity is limited by the fact that it uses an older version of. When I go to convert the list, Json just returns "".I've been researching JSON serialization/deserialization libraries for Unity, and I'm writing a spreadsheet comparing the different alternatives. I'm having no luck figuring out what my problem is on the forums. My code is a bit longer, but I am trying to save the names of my gameobjects in a Json formatted list. ![]()
0 Comments
Leave a Reply. |