コード例 #1
0
 public void GetA(string json)
 {
     answer = JSonHelper.getJsonArray <Answer>(json);
     answer1.GetComponentInChildren <Text>().text = answer[0].description;
     answer2.GetComponentInChildren <Text>().text = answer[1].description;
     answer3.GetComponentInChildren <Text>().text = answer[2].description;
     answer4.GetComponentInChildren <Text>().text = answer[3].description;
 }
コード例 #2
0
    public void GetQ(string json)
    {
        questions   = JSonHelper.getJsonArray <Question>(json);
        userAnswers = new Answer[questions.Length - 1];
        int i = 0;

        textQuestion.text = questions[i].description;
        textAmount.text   = "1/35";
        StartAnswer(questions[i].idQuestion);
    }
コード例 #3
0
    IEnumerator GetItems(WWW www, System.Action <Statistic[]> callback)
    {
        yield return(www);

        var result = new Statistic[0];

        if (www.error == null)
        {
            Statistic[] mList = JSonHelper.getJsonArray <Statistic>(www.text);
            Debug.Log("Успешно " + www.text);
            callback(mList);
        }
        else
        {
            Debug.Log("Ошибка " + www.text);
            //  SceneManager.LoadScene("error");
            callback(result);
        }
    }