| 123456789101112131415161718192021222324252627282930313233343536373839 |
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- using UnityEngine.UI;
- using UnityEngine.SceneManagement;
- public class TimeLimitGameView : MonoBehaviour
- {
- public Text nickNameTxt;
- public Text highestScoreTxt;
- public Text currentScoreTxt;
- public Text timeTxt;
- TimeLimitGameMode gameMode;
- public static TimeLimitGameView ins;
- void Start()
- {
- ins = this;
- gameMode = (TimeLimitGameMode) GameMgr.ins.gameMode;
- nickNameTxt.text = LoginMgr.myUserInfo.nickname;
- }
- void Update()
- {
- timeTxt.text = gameMode.GetTimeStr();
- currentScoreTxt.text = gameMode.score.ToString();
- }
- public void RenderHighestScoreByDistance(int distance)
- {
- int highestScore = 0;
- string distanceStr = distance.ToString();
- System.Object highestScoreObj = LoginMgr.myUserInfo.timeLimitGameHighestScores[distanceStr];
- if (highestScoreObj != null) highestScore = int.Parse(highestScoreObj.ToString());
- highestScoreTxt.text = highestScore.ToString();
- }
- }
|