JiGuiItem.cs 581 B

1234567891011121314151617181920212223
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. using UnityEngine.UI;
  5. using static Manager;
  6. public class JiGuiItem : MonoBehaviour
  7. {
  8. public Text jgname;
  9. public Text jgzgl;
  10. public Text jgsrz;
  11. public Text jgszz;
  12. public Text jgzyz;
  13. public void updateData(ServerjiguiData jg)
  14. {
  15. jgname.text = jg.name;
  16. jgzgl.text = jg.zgl.ToString("F2") + "kW";
  17. jgsrz.text = jg.srz.ToString("F2") + "kWh";
  18. jgszz.text = jg.szz.ToString("F2") + "kWh";
  19. jgzyz.text = jg.syz.ToString("F2") + "kWh";
  20. }
  21. }