private void OnCollisionEnter2D(Collision2D collision) { Defend defend = collision.collider.GetComponent <Defend>(); Debug.Log(defend); defend?.TakeDamage(combatStats.Attack); }
private void OnTriggerEnter2D(Collider2D collision) { Defend defend = collision.GetComponent <Defend>(); defend?.TakeDamage(combatStats.Attack); }