public void AddWorker(int adultIndex, HUEconomy huE, HUCarsHandler huC, GameObject workerCar) { int workingHours = possibleHoursAtWork[Random.Range(0, possibleHoursAtWork.Length - 1)]; var spawnPoint = gameObject.GetComponentInChildren <SpawnPointHandler>().node; var worker = new WHWorker(adultIndex, huE, huC, System.DateTime.Now, workingHours, spawnPoint, transform.rotation); workers.Add(worker); StartCoroutine(WorkingCoroutine(worker, workerCar)); }
public WHWorker(int adultIndex, HUEconomy myHUEconomy, HUCarsHandler myHUCarsHandler, System.DateTime workingStart, int workingHours, NodeStreet workSpawn, Quaternion rot) { this.myHUEconomy = myHUEconomy; this.myHUCarsHandler = myHUCarsHandler; this.workingStart = workingStart; this.workingHours = workingHours; this.adultIndex = adultIndex; this.workSpawn = workSpawn; this.rot = rot; }
// Start is called before the first frame update void Start() { //huGeneralManager = GetComponentInParent<HUGeneralManager>(); huGeneralManager.HUs.Add(this); // Initliaze the family itself InitFamily(); // Intialize the cars of the family and all their settings huCarsHandler = GetComponent <HUCarsHandler>(); StartCoroutine(InitCarHandler()); // Initialize the economy of the family huEconomy = GetComponent <HUEconomy>(); InitEconomy(); }