public IEnumerator Restamelo() { yield return(new WaitForSeconds(puntoresta)); PuntajeController.AgregarPuntos(puntosLess); StartCoroutine("Restamelo"); }
void OnTriggerEnter2D(Collider2D cogiste) { AudioClip clip; if (cogiste.gameObject.name == "Player") { PuntajeController.AgregarPuntos(puntosAdd); gameObject.GetComponent <AudioSource>().playOnAwake = false; clip = gameObject.GetComponent <AudioSource>().clip; AudioSource.PlayClipAtPoint(clip, new Vector3(0, 0, 0)); Destroy(gameObject); } }