void Start() { populationController = GameObject.Find("PopulationController").GetComponent(typeof(PopulationController)) as PopulationController; populationController.ChangePopulation(populationValue); navMeshAgent = gameObject.GetComponent(typeof(NavMeshAgent)) as NavMeshAgent; InhabitAFreeHouse(); }
public override void Delete() { populationController.ChangePopulation(inhabitants * -1); populationController.ChangeMaxPopulation(maxSupportedHabitants * -1); base.Delete(); }
void DestroyUnit() { populationController.ChangePopulation(populationValue * -1); Destroy(gameObject); }