private void OnTriggerExit2D(Collider2D collision) { if (collision.CompareTag(Constants.Tags.Weapon)) { this.isNearWeapon = false; this.pickupWeapon = null; } }
private void OnTriggerEnter2D(Collider2D collision) { if (collision.CompareTag(Constants.Tags.Weapon)) { this.isNearWeapon = true; this.pickupWeapon = collision.gameObject.GetComponent <FloorWeapon>(); } if (collision.CompareTag(Constants.Tags.Projectile)) { this.hp -= BulletManager.Instance.BulletDamage(collision); if (hp <= 0) { Debug.Log("Player died!"); } } }