| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858 | using Newtonsoft.Json.Linq;using Newtonsoft.Json;using System;using System.Collections;using System.Collections.Generic;using UnityEngine;using UnityEngine.Networking;using UnityEngine.Serialization;using UnityEngine.UI;using System.Threading.Tasks;using UnityAsync;using WaitUntil = UnityAsync.WaitUntil;using System.Reflection;using XCharts.Runtime;[System.Serializable]public class FloodGate{    [FormerlySerializedAs("GateNumber")] public int sensor_id;    [FormerlySerializedAs("IsOpen")] public bool gate_open;    //public float CurrentFlow;    [FormerlySerializedAs("CurrentOpening")] public float opening_degree;    public bool gate_breakdown;    public string updateTime => GetTime();    public long record_ts;    public string station_name;    private string GetTime()    {        DateTime dtDateTime = new DateTime(1970, 1, 1, 0, 0, 0, 0, DateTimeKind.Utc).AddSeconds(record_ts);        return dtDateTime.ToString("s");    }}[System.Serializable]public class FloodGateLocationData{    public FloodGate[] FloodGates;}[System.Serializable]public class FloodGateStatusData{    [FormerlySerializedAs("BuYuan")] public FloodGate[] buYuan;    [FormerlySerializedAs("TaoKou")] public FloodGate[] taoKou;    //public string taoKouSW;    //public string buYuanSW;    public CharData_water[] swzxtTK;    public CharData_water[] swzxtBY;    public bool success = false;    public int BuYuanTotalGates => buYuan.Length;    public int BuYuanOperationalGates => CountOperationalGates(buYuan);    public int TaoKouTotalGates => taoKou.Length;    public int TaoKouOperationalGates => CountOperationalGates(taoKou);    private int CountOperationalGates(FloodGate[] gates)    {        int count = 0;        foreach (var gate in gates)        {            if (!gate.gate_breakdown) count++;        }        return count;    }}[Serializable]public class ValueWithDescription{    public float value;    public string description;}[Serializable]public class FloodStorageArea{    public ValueWithDescription area;    public ValueWithDescription leveeLength;    public ValueWithDescription storageCapacity;    public ValueWithDescription designWaterLevel;    public ValueWithDescription operationStandard;    public ValueWithDescription safetyZones;    public ValueWithDescription gateStations;    public ValueWithDescription pumpStations;    public ValueWithDescription drainageStations;    public bool done = false;}[System.Serializable]public class LocationWeatherData{    public float currentWaterLevel;    public float rainfall;    public float floodDischarge;    public float temperature;    public string weather;}[System.Serializable]public class StationInspection{    public InspectionDaily daily;    public InspectionDaily monthly;    public InspectionDaily yearly;}[System.Serializable]public class InspectionDaily{    public int operationStaffCount;    public int inspectionTasksCount;    public int inspectionKilometers;    public int faultHazardCount;    public int processedFaultCount;    public int engineeringMaintenanceCount;}[System.Serializable]public class AlertData{    public bool success = false;    public Alerts alerts;}[System.Serializable]public class Alerts{    public List<AlertDataEvent> warningEvents = new List<AlertDataEvent>();    public List<AlertDataEvent> floodForecasts = new List<AlertDataEvent>();    public List<AlertDataEvent> weatherForecasts = new List<AlertDataEvent>();    public List<AlertDataEvent> threeLineWarnings = new List<AlertDataEvent>();}[System.Serializable]public class AlertDataEvent{    public int id;    public string title;    public string location;    public string time;}public class BigScreenLayer : MonoBehaviour{    public VerticalLayoutGroup content;    public Text[] floodStorageAreaData;    public RectTransform znz;    public Button gkButton;    public Button normalButton;    public Button clearBtn;    public Button exitBtn;    public Button exitJJBtn;    public Button ddysButton;    public Button exit_ddysButton;    public GameObject gk;    public GameObject normal;    public YZTLayer zTLayer;    public RectTransform miniMap;    public RectTransform rightContent;    public RingChart floodRingChart;    public Button floodButton;    public Text[] floodTexts;    public RectTransform popWindow;    public GameObject floodDataPrefab;    public Button[] floodListBtns;    public GridLayoutGroup[] floodLists;    public Button floodListExitBtn;    public Text swValue1;    public Text swValue2;    public Text swValue3;    public Text swValue4;    public Text swValue5;    public Dropdown swDrop0;    public Text yunValue1;    public Text yunValue2;    public Text yunValue3;    public Text yunValue4;    public Text yunValue5;    public Text yunValue6;    public int currentYunIndex = 0;    public Dropdown yunDrop0;    public Dropdown yunDrop1;    List<LayerBtn> layerBtns = new List<LayerBtn>();    // Start is called before the first frame update    public GameObject obsItemPrefab;    private List<ObsItem> obsItemList = new List<ObsItem>();    private Transform obsItemContent;    public ObsPlayerPanel obsPlayerPanel;    private InputField _obsSearchInputField;    public GameObject WaterRangeCtrlPanel;    public GameObject sunshigaikuangPanel;    public GameObject yjPrefab;    public Button[] yjBtns;    public GridLayoutGroup[] yjLayout;    public Sprite[] sprites;    public Text ymmjText;    public Text ymgdText;    public Text yxrkText;    public Text ccssText;    public VerticalLayoutGroup shuiShiliebiaoParent;    public List<ShuiShiLieBiaoItem> shuiShiLieBiaoItems = new List<ShuiShiLieBiaoItem>();    public ShuiShiLieBiaoItem shuiShiLieBiaoItem;    public WaterRangeCtrlTool mTools;    async void Start()    {        CameraManager.SwitchCamera(0);        StaticLod.instance.OnFoucusStatic(0);        InitButton();        obsPlayerPanel = this.transform.Find("ObsPlayerPanel").GetComponent<ObsPlayerPanel>();        obsPlayerPanel.gameObject.SetActive(false);        obsItemContent = this.transform.Find("BigSc/ShiPinJuZhen/ScrollView/Viewport/Content");        _obsSearchInputField = this.transform.Find("BigSc/ShiPinJuZhen/InputField").GetComponent<InputField>();        _obsSearchInputField.onValueChanged.AddListener(SearchObsItem);        InitFloodAreaData();        InitFloodGateData();        InitHydrologicalData();        InitLayerBtns();        InitObsItems();        InitInspectionStatistics();        InitAlert();        InitData();    }    public async void InitData()    {        WWW www = new WWW(Application.streamingAssetsPath + "/areaBaseData.json");        await new UnityAsync.WaitUntil(() => { return www.isDone; });        string areaBaseDataContent = www.text;        GlobalData.areaFHXSDatas = JsonConvert.DeserializeObject<List<AreaFHXSData>>(areaBaseDataContent);        for (int i = 0; i < GlobalData.areaFHXSDatas.Count; i++)        {            ShuiShiLieBiaoItem tempItem = Instantiate(shuiShiLieBiaoItem);            shuiShiLieBiaoItems.Add(tempItem);            tempItem.transform.SetParent(shuiShiliebiaoParent.transform);            tempItem.transform.localScale = Vector3.one;            tempItem.SetData(GlobalData.areaFHXSDatas[i]);            tempItem.Evaluate(1);        }        mTools.onCtrlChange = (float value) =>        {            float ymmj = 0;            float ymgd = 0;            float yxrk = 0;            float ccss = 0;            for (int i = 0; i < shuiShiLieBiaoItems.Count; i++)            {                shuiShiLieBiaoItems[i].Evaluate(value);                ymmj += shuiShiLieBiaoItems[i].currentMianJi;                ymgd += shuiShiLieBiaoItems[i].currentGenDi;                yxrk += shuiShiLieBiaoItems[i].currentRenKou;                ccss += shuiShiLieBiaoItems[i].currentCaiChan;            }            ymmjText.text = ymmj.ToString("0.00") + "<color=#A5BFE2>平方公里</color>";            ymgdText.text = ymgd.ToString("0.0") + "<color=#A5BFE2>亩</color>";            yxrkText.text = yxrk.ToString("0") + "<color=#A5BFE2>个</color>";            ccssText.text = ccss.ToString("0.00") + "<color=#A5BFE2>亿元</color>";        };    }    void InitButton()    {        normalButton.onClick.AddListener(() =>        {            normal.gameObject.SetActive(true);            gk.gameObject.SetActive(false);        });        gkButton.onClick.AddListener(() =>        {            gk.gameObject.SetActive(true);            miniMap.gameObject.SetActive(true);            rightContent.parent.gameObject.SetActive(false);            normal.gameObject.SetActive(false);        });        clearBtn.onClick.AddListener(() =>        {            normal.gameObject.SetActive(false);            gk.gameObject.SetActive(false);            exitBtn.gameObject.SetActive(true);            normalButton.gameObject.SetActive(false);            gkButton.gameObject.SetActive(false);            clearBtn.gameObject.SetActive(false);            ddysButton.gameObject.SetActive(false);        });        exitBtn.onClick.AddListener(() =>        {            normal.gameObject.SetActive(true);            gk.gameObject.SetActive(false);            exitBtn.gameObject.SetActive(false);            normalButton.gameObject.SetActive(true);            gkButton.gameObject.SetActive(true);            clearBtn.gameObject.SetActive(true);            ddysButton.gameObject.SetActive(true);        });        exitJJBtn.onClick.AddListener(() =>        {            normal.gameObject.SetActive(true);            gk.gameObject.SetActive(false);        });        ddysButton.onClick.AddListener(() =>        {            StaticLod.instance.OnFoucusStatic("Bird0");            normal.gameObject.SetActive(false);            gk.gameObject.SetActive(false);            normalButton.gameObject.SetActive(false);            gkButton.gameObject.SetActive(false);            clearBtn.gameObject.SetActive(false);            WaterRangeCtrlPanel.SetActive(true);            sunshigaikuangPanel.SetActive(true);        });        exit_ddysButton.onClick.AddListener(() =>        {            StaticLod.instance.OnFoucusStatic(0);            WaterRangeCtrlPanel.SetActive(false);            normal.gameObject.SetActive(true);            gk.gameObject.SetActive(false);            exitBtn.gameObject.SetActive(false);            normalButton.gameObject.SetActive(true);            gkButton.gameObject.SetActive(true);            clearBtn.gameObject.SetActive(true);            ddysButton.gameObject.SetActive(true);            sunshigaikuangPanel.SetActive(false);        });        // public Button ddysButton;        // public Button exit_ddysButton;    }    private async Task InitAlert()    {        await new WaitUntil(() =>        {            return GlobalData.alertData.success;        });        for (int i = 0; i < yjLayout.Length; i++)        {            yjLayout[i].transform.parent.parent.parent.gameObject.SetActive(false);        }        yjLayout[0].transform.parent.parent.parent.gameObject.SetActive(true);        for (int i = 0; i < GlobalData.alertData.alerts.warningEvents.Count; i++)        {            GameObject obj = Instantiate(yjPrefab);            obj.transform.SetParent(yjLayout[0].transform);            obj.transform.localScale = Vector3.one;            obj.transform.GetChild(0).GetComponent<Text>().text = GlobalData.alertData.alerts.warningEvents[i].id.ToString();            obj.transform.GetChild(1).GetComponent<Text>().text = GlobalData.alertData.alerts.warningEvents[i].title.ToString();            obj.transform.GetChild(2).GetComponent<Text>().text = GlobalData.alertData.alerts.warningEvents[i].location.ToString();            obj.transform.GetChild(3).GetComponent<Text>().text = GlobalData.alertData.alerts.warningEvents[i].time.ToString();        }        for (int i = 0; i < GlobalData.alertData.alerts.floodForecasts.Count; i++)        {            GameObject obj = Instantiate(yjPrefab);            obj.transform.SetParent(yjLayout[1].transform);            obj.transform.localScale = Vector3.one;            obj.transform.GetChild(0).GetComponent<Text>().text = GlobalData.alertData.alerts.floodForecasts[i].id.ToString();            obj.transform.GetChild(1).GetComponent<Text>().text = GlobalData.alertData.alerts.floodForecasts[i].title.ToString();            obj.transform.GetChild(2).GetComponent<Text>().text = GlobalData.alertData.alerts.floodForecasts[i].location.ToString();            obj.transform.GetChild(3).GetComponent<Text>().text = GlobalData.alertData.alerts.floodForecasts[i].time.ToString();        }        for (int i = 0; i < GlobalData.alertData.alerts.weatherForecasts.Count; i++)        {            GameObject obj = Instantiate(yjPrefab);            obj.transform.SetParent(yjLayout[2].transform);            obj.transform.localScale = Vector3.one;            obj.transform.GetChild(0).GetComponent<Text>().text = GlobalData.alertData.alerts.weatherForecasts[i].id.ToString();            obj.transform.GetChild(1).GetComponent<Text>().text = GlobalData.alertData.alerts.weatherForecasts[i].title.ToString();            obj.transform.GetChild(2).GetComponent<Text>().text = GlobalData.alertData.alerts.weatherForecasts[i].location.ToString();            obj.transform.GetChild(3).GetComponent<Text>().text = GlobalData.alertData.alerts.weatherForecasts[i].time.ToString();        }        for (int i = 0; i < GlobalData.alertData.alerts.threeLineWarnings.Count; i++)        {            GameObject obj = Instantiate(yjPrefab);            obj.transform.SetParent(yjLayout[3].transform);            obj.transform.localScale = Vector3.one;            obj.transform.GetChild(0).GetComponent<Text>().text = GlobalData.alertData.alerts.threeLineWarnings[i].id.ToString();            obj.transform.GetChild(1).GetComponent<Text>().text = GlobalData.alertData.alerts.threeLineWarnings[i].title.ToString();            obj.transform.GetChild(2).GetComponent<Text>().text = GlobalData.alertData.alerts.threeLineWarnings[i].location.ToString();            obj.transform.GetChild(3).GetComponent<Text>().text = GlobalData.alertData.alerts.threeLineWarnings[i].time.ToString();        }        for (int i = 0; i < yjBtns.Length; i++)        {            int temp = i;            yjBtns[i].onClick.AddListener(() =>            {                for (int j = 0; j < yjBtns.Length; j++)                {                    yjBtns[j].transform.GetChild(0).GetComponent<Text>().color = Color.gray;                }                yjBtns[temp].transform.GetChild(0).GetComponent<Text>().color = Color.white;                for (int j = 0; j < yjLayout.Length; j++)                {                    yjLayout[j].transform.parent.parent.parent.gameObject.SetActive(false);                }                yjLayout[temp].transform.parent.parent.parent.gameObject.SetActive(true);            });        }    }    private async Task InitHydrologicalData()    {        await new WaitUntil(() =>        {            return GlobalData.swDatas.Count > 0 && GlobalData.sWZDatas.Count > 0;        });        ChangeLocationWeatherData(0);        swDrop0.onValueChanged.AddListener((index) =>        {            ChangeLocationWeatherData(index);        });    }    private void ChangeLocationWeatherData(int index)    {        string swkey = "";        string qxKey = "";        string swKey = "";        if (index == 0)        {            swkey = "补元(上)";            qxKey = "新滩";            swKey = "新滩";        }        else        {            swkey = "套口(上)";            qxKey = "大沙";            swKey = "大沙";        }        string swH = "-";        for (int i = 0; i < GlobalData.swDatas.Count; i++) {            if (GlobalData.swDatas[i].stnm == swkey) {                swH = GlobalData.swDatas[i].upz;                break;            }        }        int qxIndex = 0;        for (int i = 0; i < GlobalData.qXZDatas.Count; i++)        {            if (GlobalData.qXZDatas[i].STNM.Contains(qxKey))            {                qxIndex = i;                break;            }        }        int swIndex = 0;        for (int i = 0; i < GlobalData.sWZDatas.Count; i++)        {            if (GlobalData.sWZDatas[i].STNM.Contains(swkey))            {                swIndex = i;                break;            }        }        swValue1.text = swH.ToString();        swValue2.text = GlobalData.qXZDatas[qxIndex].dropSum6.ToString();        string we = GlobalData.sWZDatas[swIndex].wth.ToString();        string weatherText = "";        switch (we)        {            case "9":                weatherText = "晴天";                break;            case "8":                weatherText = "阴天";                break;            case "7":                weatherText = "雨天";                break;            case "6":                weatherText = "雨夹雪";                break;            case "5":                weatherText = "雪天";                break;        }        swValue4.text = weatherText;    }    private async Task InitFloodAreaData()        {        await new WaitUntil(() =>        {            //Debug.Log(GlobalData.floodStorageArea.done);            return GlobalData.floodStorageArea.done;        });        floodStorageAreaData[0].text = GlobalData.floodStorageArea.area.value + "km²";        floodStorageAreaData[0].transform.parent.GetComponent<TipShower>().data = GlobalData.floodStorageArea.area.description;        floodStorageAreaData[1].text = GlobalData.floodStorageArea.leveeLength.value + "km";        floodStorageAreaData[1].transform.parent.GetComponent<TipShower>().data = GlobalData.floodStorageArea.leveeLength.description;        floodStorageAreaData[2].text = GlobalData.floodStorageArea.storageCapacity.value + "亿m";        floodStorageAreaData[2].transform.parent.GetComponent<TipShower>().data = GlobalData.floodStorageArea.storageCapacity.description;        floodStorageAreaData[3].text = GlobalData.floodStorageArea.designWaterLevel.value + "m";        floodStorageAreaData[3].transform.parent.GetComponent<TipShower>().data = GlobalData.floodStorageArea.designWaterLevel.description;        floodStorageAreaData[4].text = GlobalData.floodStorageArea.operationStandard.value + "级";        floodStorageAreaData[4].transform.parent.GetComponent<TipShower>().data = GlobalData.floodStorageArea.operationStandard.description;        floodStorageAreaData[5].text = GlobalData.floodStorageArea.safetyZones.value + "项";        floodStorageAreaData[5].transform.parent.GetComponent<TipShower>().data = GlobalData.floodStorageArea.safetyZones.description;        floodStorageAreaData[6].text = GlobalData.floodStorageArea.gateStations.value + "项";        floodStorageAreaData[6].transform.parent.GetComponent<TipShower>().data = GlobalData.floodStorageArea.gateStations.description;        floodStorageAreaData[7].text = GlobalData.floodStorageArea.pumpStations.value + "项";        floodStorageAreaData[7].transform.parent.GetComponent<TipShower>().data = GlobalData.floodStorageArea.pumpStations.description;        floodStorageAreaData[8].text = GlobalData.floodStorageArea.drainageStations.value + "项";        floodStorageAreaData[8].transform.parent.GetComponent<TipShower>().data = GlobalData.floodStorageArea.drainageStations.description;    }        private async Task InitFloodGateData()        {            await new WaitUntil(() =>            {                //Debug.Log("GlobalData.floorGateData.success11:" + GlobalData.floorGateData.success);                return GlobalData.floorGateData.success;                            });        await new WaitUntil(() =>            {                return GlobalData.buYuanSensorData.data.Count > 0 && GlobalData.taoKouSensorData.data.Count > 0;            });        floodTexts[0].text = (GlobalData.floorGateData.BuYuanOperationalGates + GlobalData.floorGateData.TaoKouOperationalGates).ToString();            floodTexts[1].text = (GlobalData.floorGateData.BuYuanTotalGates + GlobalData.floorGateData.TaoKouTotalGates - GlobalData.floorGateData.BuYuanOperationalGates - GlobalData.floorGateData.TaoKouOperationalGates).ToString();            floodTexts[2].text = (GlobalData.floorGateData.BuYuanTotalGates + GlobalData.floorGateData.TaoKouTotalGates).ToString();            floodButton.onClick.AddListener(() =>            {                popWindow.gameObject.SetActive(true);            });            floodListExitBtn.onClick.AddListener(() =>            {                popWindow.gameObject.SetActive(false);            });            floodListBtns[0].onClick.AddListener(() =>            {                floodListBtns[0].GetComponent<Image>().sprite = sprites[0];                floodListBtns[1].GetComponent<Image>().sprite = sprites[1];                floodLists[0].transform.parent.parent.parent.gameObject.SetActive(true);                floodLists[1].transform.parent.parent.parent.gameObject.SetActive(false);            });            floodListBtns[1].onClick.AddListener(() =>            {                floodListBtns[0].GetComponent<Image>().sprite = sprites[1];                floodListBtns[1].GetComponent<Image>().sprite = sprites[0];                floodLists[0].transform.parent.parent.parent.gameObject.SetActive(false);                floodLists[1].transform.parent.parent.parent.gameObject.SetActive(true);            });            var buyuanData = GlobalData.buYuanSensorData.data;            for (int i = 0; i < buyuanData.Count; i++)            {                GameObject floodGateDataObj = Instantiate(floodDataPrefab);                floodGateDataObj.transform.SetParent(floodLists[0].transform);                floodGateDataObj.transform.localScale = Vector3.one;                floodGateDataObj.transform.GetChild(1).GetComponent<Text>().text = (i + 1).ToString("00") + "#闸门";                floodGateDataObj.transform.GetChild(7).GetComponent<Text>().text = buyuanData[i].gate_opening ? "开启" : "关闭";                floodGateDataObj.transform.GetChild(8).GetComponent<Text>().text = "- m³/s";                floodGateDataObj.transform.GetChild(9).GetComponent<Text>().text = "m";                floodGateDataObj.transform.GetChild(10).GetComponent<Text>().text = buyuanData[i].opening_degree * 0.01 + "m";                floodGateDataObj.transform.GetChild(11).GetComponent<Text>().text = buyuanData[i].gate_breakdown ? "故障" : "正常";            }            var taokouData = GlobalData.taoKouSensorData.data;            for (int i = 0; i < taokouData.Count; i++)            {                GameObject floodGateDataObj = Instantiate(floodDataPrefab);                floodGateDataObj.transform.SetParent(floodLists[1].transform);                floodGateDataObj.transform.localScale = Vector3.one;                floodGateDataObj.transform.GetChild(1).GetComponent<Text>().text = (i + 1).ToString("00") + "#闸门";                floodGateDataObj.transform.GetChild(7).GetComponent<Text>().text = taokouData[i].gate_opening ? "开启" : "关闭";                floodGateDataObj.transform.GetChild(8).GetComponent<Text>().text = "- m³/s";                floodGateDataObj.transform.GetChild(9).GetComponent<Text>().text = "m";                floodGateDataObj.transform.GetChild(10).GetComponent<Text>().text = taokouData[i].opening_degree * 0.01 + "m";                floodGateDataObj.transform.GetChild(11).GetComponent<Text>().text = taokouData[i].gate_breakdown ? "故障" : "正常";            }            List<double> doubles = new List<double>();            doubles.Add(90);            doubles.Add(100);            floodRingChart.UpdateData(0, 0, doubles);        }        private async Task InitInspectionStatistics()        {            await new WaitUntil(() =>            {                return GlobalData.InspectionStat.Count > 0;            });            currentYunIndex = 0;            yunValue1.text = GlobalData.InspectionStat[0].daily.operationStaffCount.ToString();            yunValue2.text = GlobalData.InspectionStat[0].daily.inspectionTasksCount.ToString();            yunValue3.text = GlobalData.InspectionStat[0].daily.inspectionKilometers.ToString();            yunValue4.text = GlobalData.InspectionStat[0].daily.faultHazardCount.ToString();            yunValue5.text = GlobalData.InspectionStat[0].daily.processedFaultCount.ToString();            yunValue6.text = GlobalData.InspectionStat[0].daily.engineeringMaintenanceCount.ToString();            yunDrop0.onValueChanged.AddListener((index) =>            {                currentYunIndex = index;                SwitchStationStat(yunDrop1.value);            });            yunDrop1.onValueChanged.AddListener((index) =>            {                SwitchStationStat(index);            });        }        void SwitchStationStat(int index)        {            switch (index)            {                case 0:                    yunValue1.text = GlobalData.InspectionStat[currentYunIndex].daily.operationStaffCount.ToString();                    yunValue2.text = GlobalData.InspectionStat[currentYunIndex].daily.inspectionTasksCount.ToString();                    yunValue3.text = GlobalData.InspectionStat[currentYunIndex].daily.inspectionKilometers.ToString();                    yunValue4.text = GlobalData.InspectionStat[currentYunIndex].daily.faultHazardCount.ToString();                    yunValue5.text = GlobalData.InspectionStat[currentYunIndex].daily.processedFaultCount.ToString();                    yunValue6.text = GlobalData.InspectionStat[currentYunIndex].daily.engineeringMaintenanceCount.ToString();                    break;                case 1:                    yunValue1.text = GlobalData.InspectionStat[currentYunIndex].monthly.operationStaffCount.ToString();                    yunValue2.text = GlobalData.InspectionStat[currentYunIndex].monthly.inspectionTasksCount.ToString();                    yunValue3.text = GlobalData.InspectionStat[currentYunIndex].monthly.inspectionKilometers.ToString();                    yunValue4.text = GlobalData.InspectionStat[currentYunIndex].monthly.faultHazardCount.ToString();                    yunValue5.text = GlobalData.InspectionStat[currentYunIndex].monthly.processedFaultCount.ToString();                    yunValue6.text = GlobalData.InspectionStat[currentYunIndex].monthly.engineeringMaintenanceCount.ToString();                    break;                case 2:                    yunValue1.text = GlobalData.InspectionStat[currentYunIndex].yearly.operationStaffCount.ToString();                    yunValue2.text = GlobalData.InspectionStat[currentYunIndex].yearly.inspectionTasksCount.ToString();                    yunValue3.text = GlobalData.InspectionStat[currentYunIndex].yearly.inspectionKilometers.ToString();                    yunValue4.text = GlobalData.InspectionStat[currentYunIndex].yearly.faultHazardCount.ToString();                    yunValue5.text = GlobalData.InspectionStat[currentYunIndex].yearly.processedFaultCount.ToString();                    yunValue6.text = GlobalData.InspectionStat[currentYunIndex].yearly.engineeringMaintenanceCount.ToString();                    break;            }        }        private async Task InitLayerBtns()        {            await new WaitUntil(() =>            {                return GlobalData.layerUnitDatas.Count > 0;            });            layerBtns = new List<LayerBtn>();            for (int i = 0; i < zTLayer.layerDatas.Length; i++)            {                LayerBtn layerBtn = Instantiate(zTLayer.layerBtnPrefab);                layerBtn.SetUseful(false);                int index = i;                int num = 0;                if (i == 0)                {                    List<LayerUnitData> tempDatas = new List<LayerUnitData>(GlobalData.layerUnitDatas);                    for (int j = 0; j < tempDatas.Count; j++)                    {                        if (tempDatas[j].special == "1")                        {                            int tempJ = j;                            SecLayerBtn secLayerBtn = Instantiate(zTLayer.secLayerBtnPrefab);                            secLayerBtn.SetLayerBtnData(tempDatas[j].name);                            secLayerBtn.GetComponent<RectTransform>().SetParent(layerBtn.secContent.GetComponent<RectTransform>());                            secLayerBtn.btn.onClick.AddListener(() =>                            {                                StaticLod.instance.OnFoucusStatic(tempDatas[tempJ].namePri);                                miniMap.gameObject.SetActive(false);                                ChangeRightContent(tempJ);                            });                            num++;                        }                    }                    layerBtn.secContent.gameObject.SetActive(true);                }                else                {                    List<LayerUnitData> tempDatas = new List<LayerUnitData>(GlobalData.layerUnitDatas);                    for (int j = 0; j < tempDatas.Count; j++)                    {                        //Debug.Log(zTLayer.layerDatas.Length);                        //Debug.Log(i);                        if ((int)tempDatas[j].type == zTLayer.layerDatas[i].layerID)                        {                            int tempJ = j;                            SecLayerBtn secLayerBtn = Instantiate(zTLayer.secLayerBtnPrefab);                            secLayerBtn.SetLayerBtnData(tempDatas[j].name);                            secLayerBtn.GetComponent<RectTransform>().SetParent(layerBtn.secContent.GetComponent<RectTransform>());                            secLayerBtn.btn.onClick.AddListener(() =>                            {                                StaticLod.instance.OnFoucusStatic(tempDatas[tempJ].namePri);                                miniMap.gameObject.SetActive(false);                                ChangeRightContent(tempJ);                            });                            num++;                        }                    }                }                layerBtn.btn.GetComponent<Button>().onClick.AddListener(() =>                {                    for (int j = 0; j < layerBtns.Count; j++)                    {                        layerBtns[j].SetUseful(false);                        layerBtns[j].secContent.gameObject.SetActive(false);                    }                    layerBtns[index].SetUseful(true);                    layerBtns[index].secContent.gameObject.SetActive(true);                });                layerBtn.SetLayerBtnData(zTLayer.layerSprite[zTLayer.layerDatas[i].layerID], zTLayer.layerDatas[i].layerName, num.ToString());                layerBtn.GetComponent<RectTransform>().SetParent(content.GetComponent<RectTransform>());                layerBtn.transform.localScale = Vector3.one;                layerBtns.Add(layerBtn);            }            content.GetComponent<VerticalLayoutGroup>().SetLayoutVertical();            layerBtns[0].SetUseful(true);        }        void ChangeRightContent(int index)        {            rightContent.parent.gameObject.SetActive(true);            for (int i = 0; i < rightContent.childCount; i++)            {                rightContent.GetChild(i).gameObject.SetActive(false);            }            rightContent.GetChild(index).gameObject.SetActive(true);        }        // Update is called once per frame        void Update()        {            znz.transform.rotation = Quaternion.Lerp(znz.transform.rotation, Quaternion.Euler(0, 0, CameraManager.instance.mainCamera.transform.localEulerAngles.y), Time.deltaTime * 4);        }        public async Task InitObsItems()        {            await new WaitUntil(() =>            {                return GlobalData.obsDatas_by.Count > 0 && GlobalData.obsDatas_tk.Count > 0;            });            for (int i = 0; i < obsItemList.Count; i++)            {                Destroy(obsItemList[i].gameObject);            }            obsItemList.Clear();            var obsDatasBy = GlobalData.obsDatas_by;            for (int i = 0; i < obsDatasBy.Count; i++)            {                var tempObj = Instantiate(obsItemPrefab, obsItemContent).GetComponent<ObsItem>();                tempObj.SetData(obsDatasBy[i]);                tempObj._button.onClick.AddListener(() =>                {                    ShowObsPanel(tempObj._data);                });                obsItemList.Add(tempObj);            }            var obsDatasTk = GlobalData.obsDatas_tk;            for (int i = 0; i < obsDatasTk.Count; i++)            {                var tempObj = Instantiate(obsItemPrefab, obsItemContent).GetComponent<ObsItem>();                tempObj.SetData(obsDatasTk[i]);                tempObj._button.onClick.AddListener(() =>                {                    ShowObsPanel(tempObj._data);                });                obsItemList.Add(tempObj);            }        }        public void SearchObsItem(string s_name)        {            if (s_name.Equals(""))            {                for (int i = 0; i < obsItemList.Count; i++)                {                    obsItemList[i].gameObject.SetActive(true);                }            }            else            {                for (int i = 0; i < obsItemList.Count; i++)                {                    obsItemList[i].gameObject.SetActive(obsItemList[i]._data.name.Contains(s_name));                }            }        }        public void ShowObsPanel(ObsData _data)        {            obsPlayerPanel.gameObject.SetActive(true);            obsPlayerPanel.SetObsData(_data);            obsPlayerPanel.SetTitle(_data.name);        }    }
 |