void OnTriggerEnter2D(Collider2D other) { if (status == Status.Alive) { if (other.CompareTag(Constants.TAG_PLAYER)) { if (_hitsLeft > 0) { PlayerPrototype pp = other.GetComponent <PlayerPrototype>(); if (pp.isImmortal || pp.isShieldOn) { if (pp.isShieldOn && !pp.isImmortal) { pp.SetShield(false); } Hit(); } else { pp.Kill(); } } } } }
protected void AddShieldCollectible() { playerPrototype.SetShield(true); }