private IEnumerator LightsProgramm() { while (true) { lightsData.EnableLight(0); yield return(new WaitForSeconds(redLightDuration)); lightsData.EnableLight(1); yield return(new WaitForSeconds(orangeLightDuration)); lightsData.DisableLight(0); lightsData.DisableLight(1); lightsData.EnableLight(2); yield return(new WaitForSeconds(greenLightDuration)); lightsData.DisableLight(2); //alarm signals green for (int i = 0; i < 4; i++) { yield return(new WaitForSeconds(greenSignalDuration)); lightsData.EnableLight(2); yield return(new WaitForSeconds(greenSignalDuration)); lightsData.DisableLight(2); } } }
private IEnumerator LightsProgramm() { while (true) { for (int i = 0; i < lightsCount; i++) { lightsData.EnableLight(selectedLightIndex); yield return(new WaitForSeconds(lightActiveDuration)); lightsData.DisableLight(selectedLightIndex); //lightsData.EnableLight(nextLightIndex); SelectNextLight(); } } }