コード例 #1
0
 public void PlayerWon()
 {
     if (myPanelManager.CheckSudoku())
     {
         if (!(bestHours == 0 && bestMinutes == 0 && bestSeconds == 0))
         {
             int totalSeconds      = hours * 3600 + minutes * 60 + (int)seconds;
             int totalsBestSeconds = bestHours * 3600 + bestMinutes * 60 + (int)bestSeconds;
             if (totalSeconds < totalsBestSeconds)
             {
                 bestHours   = hours;
                 bestMinutes = minutes;
                 bestSeconds = seconds;
             }
         }
         else
         {
             bestHours   = hours;
             bestMinutes = minutes;
             bestSeconds = seconds;
         }
         myUIManager.SetBestTime(bestHours.ToString("00") + ":" + bestMinutes.ToString("00") + ":" + bestSeconds.ToString("00"));
         SaveRecord();
         ChangeState(GameState.VICTORY);
     }
 }