Example #1
0
 void TimeUpdate()   //필수
 //TODO :: 타이머가 변화 << 변화 값? 프레임을 보간하기 위해 사용한 상수를 더해보자.
 {
     timer += Time.deltaTime;
     if (timer < playTime)
     {
         uitimer.UpdateTimer(playTime - timer);
     }
     //TODO :: 타이머와 플레이 타임을 비교하여 게임 끝냄
     if (timer >= playTime)
     {
         uiendgame.Open(score);
     }
 }
Example #2
0
    //used for displaying time on HUD
    private void Update_HUD_Timer()
    {
        // get the latest timer
        float time = m_Timer.Get_Time();
        // convert to minutes
        int    minutes = (int)(Mathf.Round(time) / 60);
        int    seconds = (int)(Mathf.Round(time) % 60);
        string sec_str = seconds >= 10 ? "" + seconds : "0" + seconds;

        m_UIClock_Text.text = minutes + ":" + sec_str;

        // Updated clock timer
        if (m_State == RoundState.Playing)
        {
            uiClock.UpdateTimer(time);
        }
    }