henrikpoulsen / simplejson Goto Github PK
View Code? Open in Web Editor NEWA C# json reader/writer which is Unity3D compatible
License: MIT License
A C# json reader/writer which is Unity3D compatible
License: MIT License
Original is MIT so this one should be too. Thanks!
Hey, been using this repo for a while in projects and it works a treat, I was looking at ways to check quickly if a JSON Node contains a key, and wasn't able to find a way to do that with your version - I tried the below script but there is no definition for node.Keys in your repo.
This works with the Bunny83 SimpleJSON latest version, but we ran into another issue with their version of SimpleJSON where checking if the JSON Node was null in an if statement always returned false even if the JSON was empty! Bunny83/SimpleJSON#45 - I have reported that issue to them there referencing your repo
So your version is great for checking if a JSON Node is null, but there is no way I could see to check quickly if a JSONNode contains a key with yours other than looping through the JSON Node by a section I defined and checking if values contain a string which feels slow - any tips?
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace SimpleJSON
{
public class JSONNodeExtension : MonoBehaviour {
public static bool ContainsKey(SimpleJSON.JSONNode node, string checkKey)
{
foreach (string key in node.Keys)
{
if (key == checkKey)
return true;
}
return false;
}
}
}
Thanks for the great and robust version of SimpleJSON
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.