private void ShowScorePopup() { ScorePopup popup = scorePopup.GetComponent <ScorePopup> (); //set the score float score = (float)itemCounter.count / 6f; //(float)itemCountTotal;; int stars = (int)(score * 5f); string title = FeedbackCopies.GetTitle(stars); string message = FeedbackCopies.GetFeedback("SHOWER", stars); popup.SetStars(stars); popup.SetTitle(title); popup.SetMessage(message); popup.Show(); }
private void ShowScorePopup() { ScorePopup popup = scorePopup.GetComponent <ScorePopup> (); //set the score float timeWeight = 0.2f; float collectionWeight = 0.8f; float timePerformance = Mathf.Min(1f, (float)countDown.GetCount() / 20f); //(float)countDown.startCount; float collectionPerformance = (float)itemCounter.count / (float)itemCountGoal; float score = timePerformance * timeWeight + collectionPerformance * collectionWeight; int stars = (int)(score * 5f); string title = FeedbackCopies.GetTitle(stars); string message = FeedbackCopies.GetFeedback("LIGHT", stars); popup.SetStars(stars); popup.SetTitle(title); popup.SetMessage(message); popup.Show(); }