private void HitEnemy(EnemyCollection.EnemyInfo enemy) { if (IsRamming == true) { // Inflict damage to enemy enemy.EnemyScript.CurrentHealth -= 1; cameraAnimation.SetTrigger(KilledTrigger); // Replenish drill CurrentDrill += drillRecoverAfterKill; // Pause for a short bit Pause(pauseKillLength); } else { // Fly away from the enemy FlightDirection = FlightMode.AwayFromTheTarget; timeCollisionStarted = Time.time; // Pause for a short bit Pause(pauseHurtLength); // Inflict damage to self CurrentHealth -= enemyHitDamage; } // Grab the next enemy if this one is dead if ((enemy.EnemyScript.CurrentHealth <= 0) && (targets.HasEnemy == false)) { Finish(true); } }
public bool MatchEnemy(EnemyCollection.EnemyInfo obj) { return(obj.EnemyScript == this); }