using UnityEngine; using System.Collections; public class StarsSummary : MonoBehaviour { public StarAchieved star1, star2, star3; public void AnimateStars() { var level = LevelsManager.Instance.CurrentLevel; if (GameDataManager.Instance.Score < level.star1Threshold) { var countObjective = 0; foreach (var objective in level.objectives) { if(objective.Actual < objective.target) { countObjective++; } } if (countObjective == level.objectives.Length) { SoundManager.Play(SoundEvent.scoreSummary_levelFailed); } return; } int score = GameDataManager.Instance.Score; if (score >= level.star1Threshold) { star1.Animate(0); } if (score >= level.star2Threshold) { star2.Animate(1); } if (score >= level.star3Threshold) { star3.Animate(2); } SoundManager.Play(SoundEvent.scoreSummary_levelPassed, 2); } }