/*** ROUTINE ***/ IEnumerator FnChangeColor(int durationInBeats, int minRest, int maxRest, Color color) { int beatsRested = 0; while (beatsRested < durationInBeats) { board.RandomGraphicEntity().SetColor(color); var beatsToRest = Random.Range(minRest, maxRest); beatsRested += beatsToRest; yield return(Rest(0, beatsToRest)); } }
IEnumerator Section1Orange(int durationInBeats, int minRest, int maxRest) { int beatsRested = 0; while (beatsRested < durationInBeats) { var g = board.RandomGraphicEntity(); if (g != null) { g.SetColor(orange); } var beatsToRest = Random.Range(minRest, maxRest); beatsRested += beatsToRest; yield return(Rest(0, beatsToRest)); } }