void BajarVida() { vidaEnemigo = vidaEnemigo - DannoBala; if (vidaEnemigo == 0) { if (BumMalosNumero == 1) { GameObject bullet = ObjectPooler.SharedInstance.GetPooledObject(tag_explo); if (bullet != null) { bullet.transform.position = transform.position; bullet.SetActive(true); Destroy(gameObject); Destroy(Afterburner); Destroy(PuntoDisparo); Destroy(BAKE); manager.AumentarPuntos(10); } } if (BumMalosNumero == 2) { GameObject bullet = ObjectPooler.SharedInstance.GetPooledObject(tag_explo2); if (bullet != null) { bullet.transform.position = transform.position; bullet.SetActive(true); Destroy(gameObject); Destroy(Afterburner); Destroy(PuntoDisparo); Destroy(BAKE); manager.AumentarPuntos(10); } } } }
private void OnTriggerEnter(Collider other) { if (other.gameObject.tag == tag_enemiCat1) { manager.AumentarPuntos(50); gameObject.SetActive(false); } if (other.gameObject.tag == tag_enemiCat2) { manager.AumentarPuntos(100); gameObject.SetActive(false); } }
void Update() { if (gameObject.transform.localScale.x < 0.2) { GameManager.AumentarPuntos(50); Destroy(gameObject); for (int i = 0; i < CosasParaDesactivar.Length; i++) { CosasParaDesactivar[i].SetActive(false); } } }