TimeLimitGameView.cs 891 B

12345678910111213141516171819202122232425262728293031323334353637
  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 nickNameTxt;
  9. public Text highestScoreTxt;
  10. public Text currentScoreTxt;
  11. public Text timeTxt;
  12. TimeLimitGameMode gameMode;
  13. public static TimeLimitGameView ins;
  14. void Start()
  15. {
  16. ins = this;
  17. gameMode = (TimeLimitGameMode) GameMgr.ins.gameMode;
  18. nickNameTxt.text = LoginMgr.myUserInfo.nickname;
  19. highestScoreTxt.text = gameMode.GetHighestScore().ToString();
  20. }
  21. void Update()
  22. {
  23. timeTxt.text = gameMode.GetTimeStr();
  24. currentScoreTxt.text = gameMode.score.ToString();
  25. }
  26. public void Back()
  27. {
  28. AudioMgr.ins.PlayBtn();
  29. SceneManager.LoadScene("Home", LoadSceneMode.Single);
  30. }
  31. }