123456789101112131415161718192021222324252627282930313233343536 |
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- using UnityEngine.UI;
- public class ServerRoomManager : UpdateManager
- {
- public Text pjwendu;
- public Text pjshidu;
- public List<Text> wendulist;
- public List<Text> 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<RoomToggleChoose>().id = data.serverList[i].id;
- shidulist[i].GetComponent<RoomToggleChoose>().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;
-
- }
|