コード例 #1
0
 // interface
 public static void UnlockNextLevel()
 {
     if (SceneLoader.HasNextLevel())
     {
         string nextLevelName = SceneLoader.GetNextLevelName();
         if (ProgressState.Locked.IsStateOf(nextLevelName))
         {
             ProgressState.SetProgressState(nextLevelName, ProgressState.Unlocked);
         }
     }
 }
コード例 #2
0
 // initialisation
 private void Awake()
 {
     if (PlayerPrefs.GetString("LevelsInitialised") != "True")
     {
         foreach (string levelName in SceneLoader.GetLevelNames())
         {
             ProgressState.SetProgressState(levelName, ProgressState.Locked);
         }
         ProgressState.SetProgressState(SceneLoader.GetLevelName(1), ProgressState.Unlocked);
         PlayerPrefs.SetString("LevelsInitialised", "True");
     }
 }
コード例 #3
0
    private void PlayerSuccess()
    {
        string currentLevelName = SceneLoader.GetCurrentLevelName();

        if (!ProgressState.Optimal.IsStateOf(currentLevelName))
        {
            if (_moveNumber <= OptimalSolutionDecider.GetOptimalNumberOfMoves(currentLevelName))
            {
                ProgressState.SetProgressState(currentLevelName, ProgressState.Optimal);
                _successCounter.color = _optimalColour;
            }
            else if (!ProgressState.Complete.IsStateOf(currentLevelName))
            {
                ProgressState.SetProgressState(currentLevelName, ProgressState.Complete);
            }
        }
        LevelLockController.UnlockNextLevel();
        SwitchToSuccessUI();
    }