using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; public class ServerRoomManager : UpdateManager { public Text pjwendu; public Text pjshidu; public List wendulist; public List shidulist; public override void updateData() { base.updateData(); DataManager.Instance.GetWSD((data)=> { float wendupj = 0; float shidupj = 0; for (int i = 0; i < data.serverList.Count; i++) { wendupj = wendupj + data.serverList[i].wendu; shidupj = shidupj + data.serverList[i].shidu; wendulist[i].text = data.serverList[i].name + "\n" + data.serverList[i].wendu.ToString("F2") + "℃"; shidulist[i].text = data.serverList[i].name + "\n" + data.serverList[i].shidu.ToString("F2") + "%"; wendulist[i].GetComponent().id = data.serverList[i].id; shidulist[i].GetComponent().id = data.serverList[i].id; } wendupj = wendupj / 8f; pjwendu.text = wendupj.ToString("F2") + "℃"; shidupj = shidupj / 8f; pjshidu.text = shidupj.ToString("F2") + "%"; }); } public static int chooswsd = 0; }