IEnumerator SegmentMoveDown() { composure = GameManager.composure - 1; for (int i = compSegments.Count - 1; i > -1; i--) { // float mod = (i+1)*0.01f; Image img = compSegments[i].GetComponent <Image> (); index = UtilScript.ConvertStringtoInt(img.name); if (composure > 17) { img.color = ChangeSegmentColor(i, 0, (float)(composure), colorLow1, colorHigh1); } else if (composure > 10) { img.color = ChangeSegmentColor(i, 0, (float)(composure), colorLow2, colorHigh2); } else { img.color = ChangeSegmentColor(i, 0, (float)(composure), colorLow3, colorHigh3); } yield return(new WaitForSeconds(0.07f)); if (i > 0) { img.color = blankOuter; } else { if (composure > 1) { RemoveSegment(1); // energyManager.AddSegment (1); } StartCoroutine("SegmentMoveUp", 0); } } }
IEnumerator SegmentMoveUp(float b) { for (int i = 1; i < compSegments.Count; i++) { // float mod = 1f/(i+1); float mod = (i + 1) * GameManager.meterMod + b; Image img = compSegments[i].GetComponent <Image> (); index = UtilScript.ConvertStringtoInt(img.name); if (composure > 17) { img.color = ChangeSegmentColor(i, 0, (float)(compSegments.Count - 1), colorLow1, colorHigh1); } else if (composure > 10) { img.color = ChangeSegmentColor(i, 0, (float)(compSegments.Count - 1), colorLow2, colorHigh2); } else { img.color = ChangeSegmentColor(i, 0, (float)(compSegments.Count - 1), colorLow3, colorHigh3); } yield return(new WaitForSeconds(mod)); if (i < compSegments.Count - 1) { img.color = blankInner; } else { StartCoroutine("SegmentMoveDown"); } } }