public IEnumerator Restamelo() { yield return(new WaitForSeconds(puntoresta)); PuntajeController4.AgregarPuntos(puntosLess); StartCoroutine("Restamelo"); }
// Update is called once per frame void Update() { if (JugadorEnZona) { SuenaMusica(); record = GameObject.Find("textoPunto").GetComponent <PuntajeController4>(); PlayerPrefs.SetInt("score4", record.puntaje2); Application.LoadLevel(Menu); } }
void OnTriggerEnter2D(Collider2D cogiste) { AudioClip clip; if (cogiste.gameObject.name == "Player") { PuntajeController4.AgregarPuntos(puntosAdd); gameObject.GetComponent <AudioSource>().playOnAwake = false; clip = gameObject.GetComponent <AudioSource>().clip; AudioSource.PlayClipAtPoint(clip, new Vector3(0, 0, 0)); Destroy(gameObject); } }