示例#1
0
 private void CheckHealth()
 {
     if (_hp <= _deathlyNumber) // _deathlyNumber = 0
     {
         _shell.SetActive(false);
         _expl.Play();
         if (_player == true) //either is player
         {
             _car.Die();
         }
         else if (_player == false) // or not, and grabs Enemy AI, there will be correction here, further down the road, when teams are introduced
         {
             if (_civil == true)
             {
                 _civilian.Die();
             }
             else if (_civil == false)
             {
                 _carEn.Die(); // enemy
             }
         }
         Destroy(_thisAI, _timeToDestroy);
     }
 }