Exemple #1
0
    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();
                    }
                }
            }
        }
    }
Exemple #2
0
 protected void AddShieldCollectible()
 {
     playerPrototype.SetShield(true);
 }