Пример #1
0
    public IEnumerator GetRandomStar()
    {
        Request request = new Request("http://67.207.90.121:3000/random-star");
        Client  http    = new Client();

        yield return(http.Send(request));

        if (http.IsSuccessful())
        {
            Response           resp = http.Response();
            RandomStarResponse res  = JsonUtility.FromJson <RandomStarResponse>(resp.Body());
            starConfig.SetStarValues(res.st_age, res.st_mass, res.st_teff, res.st_lum, res.st_rad);
            starScreen.SetActive(true);
            starView.SetActive(true);
        }
    }