IEnumerator conteoFinalDePuntos() { code_Camara.Victoria(); code_LevelBreaker.AbrirSiguienteNivel(); bool movimiento = true; do { movimiento = false; for (int i = 0; i < aves.Length; i++) { if (aves[i].gameObject.GetComponent <Rigidbody2D>().velocity.magnitude > 0.1f) { movimiento = true; } } Debug.Log("Esperando Aves"); yield return(new WaitForSeconds(0.1f)); } while (movimiento); /*do{ * movimiento = false; * for (int i = 0; i < utileria.Length; i++){ * if (utileria[i].velocity.magnitude > 1.0f){ * movimiento = true; * } * } * Debug.Log("Esperando Utileria"); * yield return new WaitForSeconds(0.1f); * } while (movimiento); */ for (int i = 0; i < aves.Length; i++) { if (aves[i].lanzado == false) { PopUp_Aves.transform.position = aves[i].transform.position; PopUp_Aves.GetComponent <Animator>().Play("Oculto"); PopUp_Aves.GetComponent <Animator>().Play("Muestra"); yield return(new WaitForSeconds(0.25f)); code_Score.aumentarScore(10000); SFXPopUp(); yield return(new WaitForSeconds(1.25f)); puntosConseguidos++; Debug.Log("PuntosSumados"); } } PopUp_Aves.transform.position = Vector3.one * -100; PopUp_Aves.GetComponent <Animator>().Play("Oculto"); /*do{ * movimiento = false; * for (int i = 0; i < utileria.Length; i++){ * if (utileria[i].velocity.magnitude > 1.0f) { * movimiento = true; * } * } * Debug.Log("Esperando Utileria"); * yield return new WaitForSeconds(0.1f); * } while (movimiento);*/ Debug.Log("SE HA GANADO EL JUEGO, SE TERMINO EL CONTEO"); code_Score.Recibiendo = false; code_Score.guardarHighScore(); anim_Resultados.Play("Resultados_Victoria"); code_BGM.bajarVolumen(); SFXFanfarreas(1); yield return(new WaitForSeconds(1.0f)); StartCoroutine(corrutina_Estrellas()); }