Пример #1
0
    // Get data and parse it into objects
    IEnumerator GetResponse()
    {
        using (UnityWebRequest www = UnityWebRequest.Get(_DatabaseConnection))
        {
            yield return(www.Send());

            if (www.isNetworkError || www.isHttpError)
            {
                Debug.Log(www.error);
            }
            else
            {
                var dataString = JsonHelper.AppendWrapper(www.downloadHandler.text);
                _items = JsonHelper.FromJson <MockItem>(dataString);

                ItemsFetched();
            }
        }
    }