public void onLockScreen() { // No sound, no cookie :p if (audioSources.Length != 0) { GameObject employeeRandom = employees [Random.Range(0, employees.Length - 1)]; randomEmployeeSoundScript = employeeRandom.GetComponent <RandomEmployeeSound> (); AudioSource employeeRandomAudioSource = audioSources [Random.Range(1, audioSources.Length - 1)]; randomEmployeeSoundScript.RandomSoundness(employeeRandomAudioSource); } }
IEnumerator WokEmployeeSoundness() { inCoRoutineWok = true; int randomIndxEmployee = Random.Range(0, employees.Length); employee = employees[randomIndxEmployee]; RandomEmployeeSound randomEmployeeSound = employee.GetComponent <RandomEmployeeSound> (); randomEmployeeSound.WokSoundness(); float nextSoundTime = Random.Range(config.employeeWokAudioSourceRangeMin, config.employeeWokAudioSourceRangeMax); yield return(new WaitForSeconds(nextSoundTime)); inCoRoutineWok = false; randomNbEmployee--; }