int Min = 6;//分钟 int Stime = 0;//秒 IEnumerator CountDown() { while (Stime > 0) { timer.GetComponent<Text>().text = "0"+Min.ToString() +":"+ Stime.ToString(); yield return new WaitForSeconds(1); Stime--; } while (Stime == 0) { timer.GetComponent<Text>().text = "0" + Min.ToString() + ":" + Stime.ToString()+"0"; yield return new WaitForSeconds(1); Stime--; } while (Stime < 0)//秒减到0以后重新调用协程,分钟数减去1 { Min--; Stime = 59; StartCoroutine(CountDown()); } }