// Abandon unit public void AbandonUnit(RescueUnit unit) { // Free the spot in the rescue spot list and remove the unit form the rescued list. _rescued.Remove(unit); _usedSpots.Remove(unit.RescueSpot); RescueSpots.Add(unit.RescueSpot); // Get the gas back from the car. Gas += unit.Gas / 4; GameManager.Instance.ChangeKarma(-GameManager.Instance.KarmaPerCar); }
// Rescue unit and put it in the rescued pool behind player's car. private void RescueUnit(RescueUnit unit) { var randomSpot = RescueSpots[Random.Range(0, RescueSpots.Count)]; unit.Rescue(randomSpot); RescueSpots.Remove(randomSpot); _usedSpots.Add(randomSpot); _rescued.Add(unit); GiveGas(unit, 0.1f); GameManager.Instance.ChangeKarma(GameManager.Instance.KarmaPerCar); }