Example #1
0
    void OnTriggerEnter2D(Collider2D collider)
    {
        IDamageReceiver damageReceiver = collider.GetComponent <IDamageReceiver>();

        damageReceiver?.TakeHit(damage);
        Destroy(gameObject);
    }