This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const JSONtoURLEncoded = (element: any, key?: string, _list?: any[]) => { | |
let list = _list || []; | |
if (typeof element == "object") { | |
for (let idx in element) JSONtoURLEncoded(element[idx], key ? key + "[" + idx + "]" : idx, list); | |
} else { | |
list.push(key + "=" + encodeURIComponent(element)); | |
} | |
return list.join("&"); | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using System.Collections; | |
using System.Collections.Generic; | |
public class goLevel : MonoBehaviour { | |
//With the @ before the string, we can split a long string in many lines without getting errors | |
private string json = @"{ | |
'hello':'world', | |
'foo':'bar', | |
'count':25 |