コード例 #1
0
 private void FinishLevel()
 {
     levelFinished = true;
     PlayerContextManager.UpdateBestNumberOfMoves(CURRENT_LEVEL, currentLevelMoveCounter);
     gameInfoPanelController.setBestNumberOfMoves(PlayerContextManager.GetCurrentContext().GetBestNumberOfMovesForLevel(CURRENT_LEVEL));
     nextLevelButton.SetActive(true);
 }
コード例 #2
0
 private void PrepareNewLevel()
 {
     currentLevel = levelManager.LoadLevel(CURRENT_LEVEL);
     UpdateAllVerticesGameObjects();
     currentLevelMoveCounter = 0;
     gameInfoPanelController.setNumberOfMoves(0);
     gameInfoPanelController.setBestNumberOfMoves(PlayerContextManager.GetCurrentContext().GetBestNumberOfMovesForLevel(CURRENT_LEVEL));
     levelFinished = false;
 }
コード例 #3
0
 private void UpdateLevelButtonState(GameObject levelButton, int levelNumber)
 {
     if (PlayerContextManager.GetCurrentContext().ExistsBestNumberOfMovesForLevel(levelNumber))
     {
         int   playerBest    = PlayerContextManager.GetCurrentContext().GetBestNumberOfMovesForLevel(levelNumber);
         int[] moveThreshold = LevelManager.levelTemplates[levelNumber].GetMoves();
         if (playerBest <= moveThreshold[0])
         {
             MarkMedals(levelButton, 3);
         }
         else if (playerBest <= moveThreshold[1])
         {
             MarkMedals(levelButton, 2);
         }
         else
         {
             MarkMedals(levelButton, 1);
         }
     }
     else
     {
         MarkMedals(levelButton, 0);
         if (levelNumber > 0)
         {
             bool enableButton = PlayerContextManager.GetCurrentContext().ExistsBestNumberOfMovesForLevel(levelNumber - 1);
             if (enableButton)
             {
                 EnableButton(levelButton);
             }
             else
             {
                 DisableButton(levelButton);
             }
         }
     }
 }