added CameraMovement

This commit is contained in:
j.mei7
2022-03-05 13:01:45 +01:00
parent 0207486c95
commit 0a763cbc88
12 changed files with 286 additions and 14 deletions

View File

@@ -14,12 +14,29 @@ public class Workplace : MonoBehaviour
[SerializeField]
List<Person> workers = new List<Person>();
[SerializeField]
List<Person> activeWorkers = new List<Person>(); // Workers which are currently present and working
[SerializeField]
City city;
public void AddActiveWorker(Person worker) => activeWorkers.Add(worker);
public void RemoveActiveWorker(Person worker) => activeWorkers.Remove(worker);
void Awake()
{
city.AddWorkplace(this);
}
void Start()
{
TimeManager.OnHourUpdate += OnHourUpdate;
}
void OnHourUpdate()
{
EconomyManager.instance.AddMoney(salary * activeWorkers.Count);
}
public void AddWorker(Person worker)