Esempio n. 1
0
    // Update is called once per frame
    public void EventHappened(Service.typeOfService serv)
    {
        if (serv == Service.typeOfService.Fire)
        {
            Instantiate(fire, gameObject.transform);
            ChangeToDestroyedBuildings();
        }


        else if (serv == Service.typeOfService.Healthcare)
        {
            population--;
            if (population < 1)
            {
                ChangeToDestroyedBuildings();
            }
            SpawnAmbulance();
        }
        else if (serv == Service.typeOfService.Police)
        {
            SpawnPoliceCars();
            happines -= 10;
            if (happines < 1)
            {
                ChangeToDestroyedBuildings();
            }
        }
    }
Esempio n. 2
0
 public void setServicis(Service.typeOfService tos)
 {
     if (tos == Service.typeOfService.Police)
     {
         hasPolice = true;
     }
     if (tos == Service.typeOfService.Fire)
     {
         hasFire = true;
     }
     if (tos == Service.typeOfService.Healthcare)
     {
         hasHealtcare = true;
     }
 }