Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- struct Jotason
- {
- public WWWForm form;
- public string header;
- }
- List<Jotason> formularios;
- public void POST()
- {
- StopAllCoroutines();
- StartCoroutine(Upload());
- }
- IEnumerator Upload()
- {
- if (enviarFormularios)
- {
- loadingPanel.SetActive(true);
- int numArchivos = 0;
- foreach (Jotason archivo in formularios)
- {
- numArchivos++;
- UnityWebRequest www = UnityWebRequest.Post("https://holstein.fdi.ucm.es/tfg-mapas", archivo.form); //http://localhost:3000/posts https://holstein.fdi.ucm.es/tfg-mapas
- yield return www.SendWebRequest();
- if (www.isNetworkError || www.isHttpError)
- {
- //WriteFormError(www.error, DLogType.Form);
- //WriteFormError(www.responseCode, DLogType.Form);
- }
- else
- {
- //WriteForm("Form upload complete!", DLogType.Form);
- }
- //
- }
- yield return new WaitUntil(() => numArchivos >= formularios.Count);
- }
- //Reiniciar pal siguiente nivel
- formularios = new List<Jotason>();
- CalcularIdUsuario();
- SceneManager.LoadScene("Test_Dungeon");
- Time.timeScale = 1; //Reinicamos el tiempo
- loadingPanel.SetActive(false);
- victoryPanel.SetActive(false);
- defeatPanel.SetActive(false);
- movimientoEnemigos = false;
- StartCoroutine(bajarVolumen());
- //unityFileDebug.SetActive(true);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement