public void JSONObject_Test()
 {
     string[] data = JsonObjectParser.GetJsonObject("https://treasure-hunt-api.herokuapp.com/set?TreasureHuntID=1&ClueID=1");
     Assert.AreEqual(data[0], "GameData");
     Assert.AreEqual(data[1], "1");
     Assert.AreEqual(data[2], "1");
 }
示例#2
0
    void ReadMenuData()
    {
        var url = APIURL + "?Longitude=" + Longitude.ToString() + "&Latitude=" + Latitude.ToString();

        string[] data = JsonObjectParser.GetJsonObject(url);
        for (int i = 0; i < data.Length; i++)
        {
            DropDownMenu.options.Add(new Dropdown.OptionData(data[i]));
        }
    }
示例#3
0
    void SetClueText()
    {
        var url = APIURL + "?TreasureHuntID=" + TreasureHuntID.ToString() + "&ClueID=" + ClueID.ToString();

        string[] data = JsonObjectParser.GetJsonObject(url);
        ClueTextData  = data[3].ToString();
        ClueText.text = "Clue " + ClueID.ToString() + ": " + ClueTextData;
        ClueLongitude = Convert.ToDouble(data[4].ToString());
        ClueLatitude  = Convert.ToDouble(data[5].ToString());
    }