private object JsonObjectToObject(JSONValue obj) { switch (obj.Type) { case JSONValueType.String: return(obj.Str); case JSONValueType.Number: return(obj.Number); case JSONValueType.Boolean: return(obj.Boolean); case JSONValueType.Null: return(null); case JSONValueType.Array: return(obj.Array.Select(v => JsonObjectToObject(v.Obj)).ToList()); case JSONValueType.Object: var dict = new Dictionary <string, object>(); foreach (var prop in obj.Obj) { dict[prop.Key] = JsonObjectToObject(prop.Value); } return(dict); default: Puts("Missing type: " + obj.Type); break; } return(null); }
private static Wearable.OccupationSlots GetOccupationSlot(JSONValue value) { if (value.Type == JSONValueType.String && !string.IsNullOrEmpty(value.Str)) { return((Wearable.OccupationSlots)JsonConvert.DeserializeObject <OccupationSlotsUnity>(@"""" + value.Str + @"""", new UnityEnumConverter())); } return(0); }
public static JSON Parse <T>(T[] array) { int count = array.Length; JSON.Value[] values = new JSON.Value[count]; for (int i = 0; i < count; i++) { values[i] = new JSON.Value(array[i]); } return(new JSON(values)); }
public Image() { this["type"] = new JSON.Value(type); }
public RectTransform() { this["type"] = new JSON.Value(type); }
public Outline() { this["type"] = new JSON.Value(type); }
private object JsonObjectToObject(JSONValue obj) { switch (obj.Type) { case JSONValueType.String: return obj.Str; case JSONValueType.Number: return obj.Number; case JSONValueType.Boolean: return obj.Boolean; case JSONValueType.Null: return null; case JSONValueType.Array: return obj.Array.Select(v => JsonObjectToObject(v.Obj)).ToList(); case JSONValueType.Object: var dict = new Dictionary<string, object>(); foreach (var prop in obj.Obj) { dict[prop.Key] = JsonObjectToObject(prop.Value); } return dict; default: Puts("Missing type: " + obj.Type); break; } return null; }
public RectTransform() { this["type"] = new JSON.Value(type); }
public Image() { this["type"] = new JSON.Value(type); }
public NeedsCursor() { this["type"] = new JSON.Value(type); }
public Text() { this["type"] = new JSON.Value(type); }
public Outline() { this["type"] = new JSON.Value(type); }
public Button() { this["type"] = new JSON.Value(type); }
public Button() { this["type"] = new JSON.Value(type); }
public Text() { this["type"] = new JSON.Value(type); }
public NeedsCursor() { this["type"] = new JSON.Value(type); }