mirror of
https://github.com/DerTyp7/grow-ai-unity.git
synced 2025-11-02 06:02:30 +01:00
added CameraMovement
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user