void OnWaveEnd() { if (scoutState == 2) { daysScouting++; if (scoutManager.DoesScoutDie(daysScouting)) { scoutState = 0; scoutManager.ShowIcon(); reportManager.AddToReport(ReportManager.ReportTypes.ScoutDied); survivorManager.KillSurvivor(gameObject); database.specialisations [specialisationID].currentCount--; Destroy(gameObject); } } else if (scoutState == 3) // returning { scoutState = 0; UpdateSpecialisation(0); transform.localScale = Vector3.one; reportManager.AddToReport(ReportManager.ReportTypes.ScoutReturned); gameObject.tag = "Survivor"; daysScouting = 0; scoutManager.GetScoutItems(daysScouting); } }
public void ChangePopulation(int change) { if (change < 0) { change = Mathf.Abs(change); for (int i = 0; i < change; i++) { List <Survivor> temp = survivorManager.Survivors; if (temp.Count > 0) { int index = Random.Range(0, temp.Count); survivorManager.KillSurvivor(temp[index]); } else { Debug.Log("no one left to kill"); break; } } } else if (change > 0) { survivorManager.AddSurvivor(change); } }