using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; using XCharts.Runtime; public class DeMaGongYeCheJian : MonoBehaviour { public RingChart rcr; public RingChart rcg; public RingChart rcd; public RingChart rcl; public Text rcrt; public Text rcgt; public Text rcdt; public Text rclt; private void OnEnable() { DeMaDataManager.Instance.GetDeviceInfo( GameManager.Instance.getID(this.gameObject.GetComponent().tapName),(msg)=>{ int total =int.Parse(msg["data"]["run"].ToString())+ int.Parse(msg["data"]["standby"].ToString())+ int.Parse(msg["data"]["fault"].ToString())+ int.Parse(msg["data"]["offline"].ToString()); if(total==0) { total = 1; } SerieData data1 = rcr.series[0].GetSerieData(0); data1.data[0] = int.Parse(msg["data"]["run"].ToString()); data1.data[1] = total; rcrt.text = msg["data"]["run"].ToString()+"台"; SerieData data2 = rcg.series[0].GetSerieData(0); data2.data[0] = int.Parse(msg["data"]["standby"].ToString()); data2.data[1] = total; rcgt.text = msg["data"]["standby"].ToString()+"台"; SerieData data3 = rcd.series[0].GetSerieData(0); data3.data[0] = int.Parse(msg["data"]["fault"].ToString()); data3.data[1] = total; rcdt.text = msg["data"]["fault"].ToString()+"台"; SerieData data4 = rcl.series[0].GetSerieData(0); data4.data[0] = int.Parse(msg["data"]["offline"].ToString()); data4.data[1] = total; rclt.text = msg["data"]["offline"].ToString()+"台"; }); } }