public void Die() { box_particles.SpawnParticle(transform); CombatEvents.EnemyDied(this); Debug.Log("killed box"); gameObject.SetActive(false); }
//when it hits anything so be vigilant about adding stuff private void OnCollisionEnter2D(Collision2D collision) { for (int i = 0; i < tags.Length; i++) { if (collision.collider.tag == tags[i]) { particles.SpawnParticle(transform); gameObject.SetActive(false); Debug.Log("player projectile hit :" + collision.collider.tag); } } if (collision.collider.tag == "TurnObjectsOn") { gameObject.SetActive(false); Debug.Log("player projectile hit :" + collision.collider.tag); } }