LoadShow.cs 732 B

12345678910111213141516171819202122232425262728293031323334
  1. using QFramework;
  2. using System.Collections;
  3. using System.Collections.Generic;
  4. using UnityEngine;
  5. using UnityEngine.UI;
  6. public class LoadShow : MonoSingleton<LoadShow>
  7. {
  8. public int allDownLoad;
  9. public Text text;
  10. public GameObject view;
  11. float progress;
  12. void Start()
  13. {
  14. }
  15. // Update is called once per frame
  16. void Update()
  17. {
  18. if (view.activeSelf)
  19. {
  20. progress = (float)(allDownLoad - (DownLoadManage.Instance.AllDownLoad + DownLoadManage.Instance.NowDownLoad)) / (float)allDownLoad*100;
  21. text.text = progress.ToString("F2")+"%";
  22. }
  23. }
  24. public void ViewShow(bool state)
  25. {
  26. view.SetActive(state);
  27. }
  28. }