Ejemplo n.º 1
0
    public void Init(int levelIndex)
    {
        Index = levelIndex;
        info  = Player.Instance.Info(Index);
        level = MainMenu.Instance.LoadedLevels.First(x => x.Name == (Index + 1).ToString(CultureInfo.InvariantCulture));

        LevelNumberTitle.text = LocalizationStrings.GetString(LevelNumberString, info.Number);
        BestScoreLabel.text   = LocalizationStrings.GetString(BestScoreString, info.BestScore);


        TaskLabel.text = LocalizationStrings.GetString(TaskString, GameModeToString.GetString(GameModeFactory.CreateGameMode(level.GameMode)));
    }
Ejemplo n.º 2
0
 public static string GetString(GameMode gameMode)
 {
     if (gameMode is TargetChuzzleGameMode)
     {
         return(LocalizationStrings.GetString(ChuzzleString, (gameMode as TargetChuzzleGameMode).Amount,
                                              gameMode.Turns));
     }
     if (gameMode is TargetPlaceGameMode)
     {
         return(LocalizationStrings.GetString(PlaceString, gameMode.Turns));
     }
     if (gameMode is TargetScoreGameMode)
     {
         return(LocalizationStrings.GetString(ScoreString, (gameMode as TargetScoreGameMode).TargetScore,
                                              gameMode.Turns));
     }
     throw new NotImplementedException("Unknown game mode");
 }
Ejemplo n.º 3
0
 private void OnTurnsChanged(int turns, int maxTurns)
 {
     TurnsLabel.text = LocalizationStrings.GetString(TurnsString, turns);
     TurnsBar.value  = ((float)turns) / maxTurns;
 }
Ejemplo n.º 4
0
 private void OnPointsChanged(int points, int targetPoints)
 {
     PointsLabel.text = LocalizationStrings.GetString(PointsString, points);
     PointsBar.value  = ((float)points) / targetPoints;
 }