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(); } }