UIRenShuTongJi.cs 1.2 KB

123456789101112131415161718192021222324252627282930313233
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityCommon;
  4. using UnityEngine;
  5. using UnityEngine.UI;
  6. namespace DTYJ
  7. {
  8. public class UIRenShuTongJi : MonoBehaviour
  9. {
  10. public Text text_zhantai, text_zhanting;
  11. private Text textLabel;
  12. private void Start()
  13. {
  14. textLabel = transform.Find("Image/Label").GetComponent<Text>();
  15. Utility.Update(2, () =>
  16. {
  17. text_zhantai.text = (RenShuTrigger.dicCount["站台"] / 500f).ToString("#0.00");
  18. text_zhanting.text = (RenShuTrigger.dicCount["站厅"] / 700f).ToString("#0.00");
  19. textLabel.text = $"乘客人数:{RenShuTrigger.dicCount["站台"] + RenShuTrigger.dicCount["站厅"]}";
  20. var cmdObj = new KeLiu_opt();
  21. cmdObj.kvp = new KeLiu_opt.Info[] {
  22. new KeLiu_opt.Info(){ postion = "站台", value = RenShuTrigger.dicCount["站台"]/500f},
  23. new KeLiu_opt.Info(){ postion = "站厅 ", value = RenShuTrigger.dicCount["站厅"]/700f}
  24. };
  25. NetworkAnimPlayer.instance?.SendCmdToServer(20501, cmdObj);
  26. });
  27. }
  28. }
  29. }