1234567891011121314151617181920212223242526272829303132 |
- 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") + "%";
- }
- wendupj = wendupj / 8f;
- pjwendu.text = wendupj.ToString("F2") + "℃";
- shidupj = shidupj / 8f;
- pjshidu.text = shidupj.ToString("F2") + "%";
- });
- }
- }
|