public void UpdateContent()
    {
        w = gameObject.GetComponent <WeatherAPIScript>();
        if (w.finished)
        {
            temp        = w.temperature;
            city        = w.city;
            country     = w.country;
            main        = w.main;
            description = w.description;

            if (temp < 20)
            {
                TempState = 0;
            }
            else if (temp <= 25 && temp >= 20)
            {
                TempState = 1;
            }
            else
            {
                TempState = 2;
            }

            if (main == "Thunderstorm" || main == "Drizzle" || main == "Rain" || main == "Snow" || main == "Fog" || main == "Mist" || main == "Haze")
            {
                FeuchtState = 0;
            }
            else if (main == "Clouds" || main == "Squall" || main == "Tornado")
            {
                FeuchtState = 1;
            }
            else
            {
                FeuchtState = 2;
            }

            text.text = "Country:   " + country + "\nCity:   " + city + "\nTemperature:   " + temp + "\nWeather:   " + main;
        }
        else
        {
            w = gameObject.GetComponent <WeatherAPIScript>();
            StartCoroutine(StartReq());
        }
    }
Exemple #2
0
 void Start()
 {
     w = gameObject.GetComponent <WeatherAPIScript>();
     StartCoroutine(StartReq());
 }