/// <summary> /// 在战斗UI上实时显示游戏时间 /// </summary> void Update() { if (m_game != null) { int time; if (m_game.IsTimelimited) { time = m_game.GetRemainTime(); //second } else { time = m_game.GetElapsedTime(); } txtTimeInfo.text = TimeUtils.GetTimeString("%hh:%mm:%ss", time); } }
/// <summary> /// show game time /// </summary> void Update() { if (m_game != null) { int time; if (m_game.IsTimelimited) { time = m_game.GetRemainTime();//second } else { time = m_game.GetElapsedTime(); } txtTimeInfo.text = TimeUtils.GetTimeString("%hh:%mm:%ss", time); //when game ends, score is reset to 0, in this case do not update if (!GetPlayerScore().Equals("0")) { txtScoreInfo.text = "score:" + GetPlayerScore(); cur_score = GetPlayerScore(); } } }