BiologyGameUI.cs 916 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. using UnityEngine.UI;
  5. public class BiologyGameUI : MRBaseUI
  6. {
  7. [SerializeField]
  8. private Text TimeText;
  9. [SerializeField]
  10. private Text ScoreText;
  11. private string time_format_str = "倒计时 : {0} 秒";
  12. private string score_format_str = "得分 : {0}";
  13. protected override void Start()
  14. {
  15. base.Start();
  16. InitScore();
  17. }
  18. private void OnDestroy()
  19. {
  20. }
  21. private void InitScore()
  22. {
  23. RefreshText(0,0);
  24. }
  25. public void RefreshText(int time, int score)
  26. {
  27. TimeText.text = string.Format(time_format_str, time.ToString());
  28. ScoreText.text = string.Format(score_format_str, score.ToString());
  29. /*
  30. if (this.mData != null)
  31. this.mData.score = score;//
  32. */
  33. }
  34. }