| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758 | 
							- using System;
 
- using System.Collections;
 
- using System.Collections.Generic;
 
- using UnityEngine;
 
- using UnityEngine.UI;
 
- public class ShuiWeiHistoryPanel : MonoBehaviour
 
- {
 
-     private Button closeButton;
 
-     public ShuiWeiData currentData;
 
-     public GameObject ShuiWeiHistoryItemPrefab;
 
-     public Transform historyItemContent;
 
-     public List<GameObject> historyItems=new List<GameObject>();
 
-     public Text dangqianText;
 
-     public Text dangriText;
 
-     public Text historyMax;
 
-     public Text historyAvg;
 
-     
 
-     public void Init()
 
-     {
 
-         closeButton = this.transform.Find("CloseButton").GetComponent<Button>();
 
-         closeButton.onClick.AddListener(() =>
 
-         {
 
-             this.gameObject.SetActive(false);
 
-         });
 
-         dangqianText = this.transform.Find("DangQianZuiGaoShuiWei/value").GetComponent<Text>();
 
-         dangriText = this.transform.Find("DangRiZuiGaoShuiWei/value").GetComponent<Text>();
 
-         historyMax = this.transform.Find("LiShiZuiGaoShuiWei/value").GetComponent<Text>();
 
-         historyAvg = this.transform.Find("LiShiPingJunShuiWei/value").GetComponent<Text>();
 
-         historyItemContent = this.transform.Find("GongChengLieBiao/ScrollView/Viewport/Content").GetComponent<Transform>();
 
-     }
 
-     public void SetData(ShuiWeiData data)
 
-     {
 
-         for (int i = 0; i < historyItems.Count; i++)
 
-         {
 
-             Destroy(historyItems[i]);
 
-         }
 
-         historyItems.Clear();
 
-         currentData = data;
 
-         dangqianText.text = $"{currentData.datas[0].NodeValue} <color=#A5BFE2>mm</color>";
 
-         dangriText.text = $"{currentData.datas[0].NodeValue} <color=#A5BFE2>mm</color>";
 
-         historyMax.text = $"{currentData.datas[0].MaxNodeValue} <color=#A5BFE2>mm</color>";
 
-         historyAvg.text = $"{currentData.datas[0].AvgNodeValue} <color=#A5BFE2>mm</color>";
 
-         
 
-         for (int i = 0; i < currentData.datas.Length; i++)
 
-         {
 
-             var temp = Instantiate(ShuiWeiHistoryItemPrefab, historyItemContent).GetComponent<ShuiWeiHistoryItem>();
 
-             temp.Init();
 
-             temp.SetData(currentData.datas[i],i+1);
 
-             historyItems.Add(temp.gameObject);
 
-         }
 
-     }
 
- }
 
 
  |