private IEnumerator DoScoreComputation() { yield return(null); var data = new MutableLevelData { Background = Background, Bubbles = models.Values, Queue = queue, Randoms = randoms.ToArray(), ShotCount = queue.ShotCount, }; var newValues = ScoreUtil.ComputeStarsForLevel(data, BubbleFactory); for (int index = 0, count = newValues.Length; index < count; index++) { newValues[index] = (int)(newValues[index] * LevelProperties.StarMultiplier); } LevelProperties.StarValues = newValues; LevelProperties.NotifyListeners(); scoreCoroutine = null; }
public string SaveLevel() { var data = new MutableLevelData { Background = Background, Bubbles = models.Values, Queue = queue, Randoms = randoms.ToArray(), ShotCount = queue.ShotCount, }; LevelProperties.StarValues = ScoreUtil.ComputeStarsForLevel(data, BubbleFactory); LevelProperties.NotifyListeners(); LevelProperties.ToLevelData(data); return(JsonUtility.ToJson(data)); }