//References the Center_Object and the Data_Manager on it void Start() { Center_Object = GameObject.FindGameObjectWithTag("Center_Object"); data_manager_script = Center_Object.GetComponent <Data_Manager>(); //Adds jobs to the jobs list data_manager_script.Change_Jobs(0, max_employed); }
void Start() { //References some objects in the game Center_Object = GameObject.FindGameObjectWithTag("Center_Object"); data_manager_script = Center_Object.GetComponent <Data_Manager>(); //Sets up the time delay next_time = Time.time + add_time; //Calculates the size of the farm area = (gameObject.transform.localScale.x) * (gameObject.transform.localScale.z); //Makes the max_employed propotrional to a 25th of the area max_employed = Mathf.Ceil(area / 25); //Adds the jobs to the list data_manager_script.Change_Jobs(2, max_employed); }