Esempio n. 1
0
    public IEnumerator StartReq()
    {
        yield return(StartCoroutine((w.OnResponse(w.request()))));

        temp        = w.temperature;
        city        = w.city;
        country     = w.country;
        main        = w.main;
        description = w.description;

        text.text = "Country:   " + country + "\nCity:   " + city + "\nTemperature:   " + temp + "\nWeather:   " + main;
    }
    public IEnumerator StartReq()
    {
        WWW request;

        if (!Input.location.isEnabledByUser)
        {
            w.setCity(11.77f, 48.45f);
            request = new WWW(w.URL);
        }
        else
        {
            yield return(StartCoroutine(w.StartRequest()));

            request = new WWW(w.URL);
        }
        yield return(StartCoroutine(w.OnResponse(request)));

        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;
        FirebaseLobbyManager.flm.SyncWeatherData((byte)FeuchtState, (byte)TempState);
    }