TimeLimitGameView.cs 794 B

1234567891011121314151617181920212223242526272829303132333435
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. using UnityEngine.UI;
  5. using UnityEngine.SceneManagement;
  6. public class TimeLimitGameView : MonoBehaviour
  7. {
  8. public Text highestScoreTxt;
  9. public Text currentScoreTxt;
  10. public Text timeTxt;
  11. GameMode1 gameMode;
  12. public static TimeLimitGameView ins;
  13. void Start()
  14. {
  15. ins = this;
  16. gameMode = (GameMode1) GameMgr.ins.gameMode;
  17. highestScoreTxt.text = gameMode.GetHighestScore().ToString();
  18. }
  19. void FixedUpdate()
  20. {
  21. timeTxt.text = gameMode.GetTimeStr();
  22. currentScoreTxt.text = gameMode.score.ToString();
  23. }
  24. public void Back()
  25. {
  26. AudioMgr.ins.PlayBtn();
  27. SceneManager.LoadScene("Home", LoadSceneMode.Single);
  28. }
  29. }