public void OnTriggerEnter2D(Collider2D other) { if (other.tag == ignoreTag) { return; } if (other.tag == "Enemy" || other.tag == "Player") { CharacterData characterData = other.GetComponent <CharacterData>(); base.ApplyDamage(characterData); foreach (Effect effect in base.effects) { characterData.AddEffect(effect); } } }
private void OnTriggerEnter2D(Collider2D collision) { if (collision.tag == ignoreTag) { return; } print(collision.name); if (collision.tag == "Enemy" || collision.tag == "Player") { CharacterData characterData = collision.GetComponent <CharacterData>(); base.ApplyDamage(characterData); foreach (Effect effect in base.effects) { characterData.AddEffect(effect); } Destroy(gameObject); } else { Destroy(gameObject); } }