Esempio n. 1
0
 void TakeHealthPackage()
 {
     nav.speed       = chaseSpeed;
     nav.destination = enemySight.currentHealthPackage.transform.position;
     if (nav.remainingDistance < 1.2)
     {
         if (!takingHealthPackage)
         {
             healthTakeStart     = Time.time;
             takingHealthPackage = true;
         }
         else if (Time.time - healthTakeStart > HEALTH_TAKE_DURATION)
         {
             enemyHealth.AddHealth(20);
             takingHealthPackage = false;
         }
     }
 }