Exemple #1
0
    IEnumerator GetConfigFromServer(Action <string> method)
    {
        ClientServer Client = new ClientServer(Battery.Instance.GetServerURL());

        UnityWebRequest get = Client.UpdateServerCreateRequest();

        yield return(get.SendWebRequest());

        if (get.result != UnityWebRequest.Result.Success)
        {
            Console.text = "Network Error\n" + get.error;
        }
        else
        {
            method(get.downloadHandler.text);
        }
    }