public IEnumerator IData() { yield return null; while (true) { TemperatureData(45f, 50f); yield return new WaitForSeconds(2f); } } void TemperatureData(float TData1, float TData2) { //1-1温度显示 float _TData1= Random.Range(TData1, TData2); DataShow[0].text = _TData1.ToString("#0.0"); //1-2温度显示 float _TData2 = Random.Range(TData1, TData2); DataShow[1].text = _TData2.ToString("#0.0"); //1-3温度显示 float _TData3 = Random.Range(TData1, TData2); DataShow[2].text = _TData3.ToString("#0.0"); //1-4温度显示 float _TData4 = Random.Range(TData1, TData2); DataShow[3].text = _TData4.ToString("#0.0"); //1-5温度显示 float _TData5 = Random.Range(TData1, TData2); DataShow[4].text = _TData5.ToString("#0.0"); //1-6温度显示 float _TData6 = Random.Range(TData1, TData2); DataShow[5].text = _TData6.ToString("#0.0"); //1-7温度显示 float _TData7 = Random.Range(TData1, TData2); DataShow[6].text = _TData7.ToString("#0.0"); //1-8温度显示 float _TData8 = Random.Range(TData1, TData2); DataShow[7].text = _TData8.ToString("#0.0"); }