Beispiel #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();
                    }
                }
            }
        }
    }
Beispiel #2
0
 void OnTriggerEnter2D(Collider2D other)
 {
     if (other.CompareTag(Constants.TAG_PLAYER))
     {
         PlayerPrototype pp = other.GetComponent <PlayerPrototype>();
         if (pp != null)
         {
             pp.Kill();
         }
         _state = State.Stop;
     }
 }