I believe you want is something like:
public static IEnumerator FadeMaterialColors(Material m, Color[] colors, float speed,
ProgressCurve type){
for (int i = 0; i < colors.Length; i++){
yield return StartCoroutine(FadeMaterialColorTo(m, colors[i%2], speed, type));
}
yield return null;
}
IIRC, something like yield return somefunction()
will yield only once if you have another nested yield inside somefunction()
, as you do with the yield return null
in the body of your while
loop.