예제 #1
0
        /// <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);
            }
        }
예제 #2
0
 /// <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();
         }
     }
 }