IEnumerator ScoreUpdater() { while (true) { if (currentScore < actualScore) { if (actualScore - currentScore > 1300) { currentScore += 1000; } else if (actualScore - currentScore > 130) { currentScore += 100; } else { currentScore += Mathf.Min(10, actualScore - currentScore); } label.text = ScoreSystem.FormatScore(currentScore); yield return(new WaitForSeconds(0.08f)); } else { yield return(null); } } }
void Start() { label = GetComponent <UILabel>(); UpdateScore(); if (index != 0) { ScoreSystem.Instance.OnScoreUpdated += UpdateScore; } if (index == 1) { label.text = ScoreSystem.FormatScore(currentScore); StartCoroutine(ScoreUpdater()); } }
void Start() { label = GetComponent <UILabel>(); loseIsMoves = (gameLogic.loseConditions is LoseMoves); loseMoves = (gameLogic.loseConditions as LoseMoves); loseTimer = (gameLogic.loseConditions as LoseTimer); if (index == 1) { secondsLabel.gameObject.SetActive(gameLogic.loseConditions is LoseTimer); } UpdateText(); if (index == 1) { label.text = ScoreSystem.FormatScore(currentValue); StartCoroutine(ValueUpdater()); } }
public void UpdateBestScore() { label.text = Language.Get("BEST").Replace("<SPACE>", " ") + ":\n" + ScoreSystem.FormatScore(WinScore.bestScore); }
void Start() { label = GetComponent <UILabel>(); label.text = Language.Get("LEVEL_TARGET") + " " + ScoreSystem.FormatScore((gameLogic.winConditions as WinScore).targetScore); //label.text = "Target: " + ScoreSystem.FormatScore((gameLogic.winConditions as WinScore).targetScore); }
void UpdateFinalScore() { label.text = Language.Get("GAME_SCORE").Replace("<SPACE>", " ") + ": " + ScoreSystem.FormatScore(ScoreSystem.Instance.Score) + " / " + ScoreSystem.FormatScore((gameLogic.winConditions as WinScore).targetScore); }
public string GetScoreString() { return(ScoreSystem.FormatScore(score)); }
public void UpdateCompanions(int[] indexes) { if (indexes.Length > 1) { chooseLabelLandscape.GetComponent <UILabel>().text = Language.Get("LEVEL_CHOOSE_COMPANION"); chooseLabelPortrait.GetComponent <UILabel>().text = Language.Get("LEVEL_CHOOSE_COMPANION"); } else { chooseLabelLandscape.GetComponent <UILabel>().text = Language.Get("LEVEL_COMPANION"); chooseLabelPortrait.GetComponent <UILabel>().text = Language.Get("LEVEL_COMPANION"); } CharacterSpecialAnimations.characterIndex = -1; for (int i = 0; i < 4; ++i) { companionsLandscape[i].gameObject.SetActive(i < indexes.Length); companionsPortrait[i].gameObject.SetActive(i < indexes.Length); companionsLandscape[i].selected = i == 0; companionsPortrait[i].selected = i == 0; companionsLandscape[i].transform.localPosition = positionsLandscape[i] + (positionsLandscape[1] - positionsLandscape[0]) * (4 - indexes.Length) * 0.5f; companionsPortrait[i].transform.localPosition = positionsPortrait[i] + (positionsPortrait[1] - positionsPortrait[0]) * (4 - indexes.Length) * 0.5f; if (i < indexes.Length) { companionsLandscape[i].UpdateCompanion(indexes[i]); companionsPortrait[i].UpdateCompanion(indexes[i]); } } tokensLabelLandscape.UpdateStatus(); tokensLabelPortrait.UpdateStatus(); GameObject levelPrefab = Resources.Load("Game/Levels/Level" + Match3BoardRenderer.levelIdx) as GameObject; if (levelPrefab != null) { Match3BoardRenderer levelData = levelPrefab.GetComponent <Match3BoardRenderer>(); if (levelData != null) { string key = "Level" + Match3BoardRenderer.levelIdx + "Star1"; if (TweaksSystem.Instance.intValues.ContainsKey(key)) { targetLabelLandscape.text = Language.Get("LEVEL_TARGET") + " " + ScoreSystem.FormatScore(TweaksSystem.Instance.intValues[key]); } else { targetLabelLandscape.text = Language.Get("LEVEL_TARGET") + " " + ScoreSystem.FormatScore((levelData.winConditions as WinScore).targetScore); } targetLabelPortrait.text = targetLabelLandscape.text; //objectiveLabelLandscape.text = Language.Get("LEVEL_OBJECTIVE") + "\n" + levelData.winConditions.GetObjectiveString(); objectiveLabelLandscape.text = levelData.winConditions.GetShortObjectiveString(levelData.loseConditions); objectiveLabelPortrait.text = objectiveLabelLandscape.text; foreach (LevelDestroyTargets target in destroyTargets) { target.UpdateValues(levelData.winConditions); } Vector3 newPos = targetLabelPortrait.transform.localPosition; if (levelData.winConditions.GetType() != typeof(WinDestroyTiles) && levelData.winConditions.GetType() != typeof(WinDestroyTilesDrop)) { newPos.y = 112f; } else { newPos.y = 86f; } targetLabelPortrait.transform.localPosition = newPos; targetLabelLandscape.transform.localPosition = targetLabelPortrait.transform.localPosition; } // levelPrefab = null; // Resources.UnloadUnusedAssets(); } }