public void btnbnext() { if (cont == 10) { source.clip = gana; } if (cont >= 10) { if (sc2 != null) { sc2.estado = "COMPLETADO"; sc2.nivel = cont; sc2.score = intentos; Debug.Log(sc2.estudianteId._id); Debug.Log(sc2.juegoId._id); PostPuntaje postPuntaje = new PostPuntaje() { score = sc2.score, estado = sc2.estado, nivel = sc2.nivel, fecha = sc2.fecha, estudianteId = sc2.estudianteId._id, juegoId = sc2.juegoId._id }; //db.Updatescore("etiquetar",sc); StartCoroutine(PostActualizarPuntaje(postPuntajeEditUrl, postPuntaje, sc2._id)); } else { sc = new score(0, "" + intentos, "" + DateTime.Now, "completado", cont); PostPuntaje postPuntaje = new PostPuntaje() { score = intentos, nivel = 10, fecha = DateTime.Now.ToString(), estado = "completado", estudianteId = LoginE.getlog()._id, juegoId = idjuego }; //db.GuardarScore(sc, "etiquetar"); StartCoroutine(PostAgregarPuntaje(postJuegoCreateUrl, postPuntaje)); } SceneManager.LoadScene("Principal"); } else { Reload(); } }
public void MostrarMenuGanador() { if (cont >= 10) { if (sc2 != null) { sc2.estado = "COMPLETADO"; sc2.nivel = aux; sc2.score = intentos; //db.Updatescore("Laterabilidad", sc); Debug.Log(sc2.estudianteId._id); Debug.Log(sc2.juegoId._id); PostPuntaje postPuntaje = new PostPuntaje() { score = sc2.score, estado = sc2.estado, nivel = sc2.nivel, fecha = sc2.fecha, estudianteId = sc2.estudianteId._id, juegoId = sc2.juegoId._id }; StartCoroutine(PostActualizarPuntaje(postPuntajeEditUrl, postPuntaje, sc2._id)); } else { sc = new score(0, "" + intentos, "" + DateTime.Now, "completado", cont); PostPuntaje postPuntaje = new PostPuntaje() { score = intentos, nivel = 1, fecha = DateTime.Now.ToString(), estado = "completado", estudianteId = LoginE.getlog()._id, juegoId = idjuego }; StartCoroutine(PostAgregarPuntaje(postJuegoCreateUrl, postPuntaje)); // db.GuardarScore(sc, "Laterabilidad"); } SceneManager.LoadScene("Principal"); } menuGanador.SetActive(true); menuMostradoGanador = true; textoMenuGanador.text = "HAS GANADO!" + '\n' + "Has encontrado todas las parejas en " + '\n' + tiempo; segundosTot += SegundosCronometro; }