public void sendFeedback() { var feedbackText = feedbackForm.text; if (feedbackText != "") { FeedbackScript.sendEmail(feedbackText); GameAnalytics.NewErrorEvent(GAErrorSeverity.Info, feedbackText); } hideAllRatePopups(); }
public void CheckAnswer(Toggle choice) { if (choice.isOn) { answer = choice.transform.parent.Find("Feedback/OptionTypeValue").GetComponent <TextMeshProUGUI>(); //For wide choices //answer = choice.transform.parent.parent.Find("Feedback/OptionTypeValue").GetComponent<Text>(); //For shrunken choices FeedbackScript feedback = GetComponentInChildren <FeedbackScript>(); feedback.OptionValue = answer.text; feedback.shownFeedbackBackground = choice.transform.parent.GetComponent <Image>(); feedback.Feedback = choice.transform.parent.Find("Feedback/FeedbackBG/FeedbackValue").GetComponent <TextMeshProUGUI>().text; feedback.IsOn = choice.isOn; //feedback.loadedFeedbackText = choice.transform.parent.parent.Find("Feedback/FeedbackBG/FeedbackValue").GetComponent<Text>(); feedback.ShowResponse(); //Comment out these lines to not display per-answer feedback. Remove the first statement to always show C/PC/I if (feedback.Feedback.Equals("")) { feedback.Feedback = null; feedback.GetComponent <CollapseContentScript>().SetTarget(false); } else { feedback.SetColor(feedback.GetComponent <Image>()); feedback.GetComponent <CollapseContentScript>().SetTarget(true); if (!feedback.OptionValue.Equals("Correct")) { // !!TODO: make sure dialogue choices still work properly //feedback.shownFeedbackText = feedback.shownFeedbackText.text + "\n\nPlease try again!"; } } if (answer.text.Equals("Correct")) { choice.GetComponent <DialogueAnswerChecker>().HideOtherChoices(); HideInstructions(); ShowBelow(); return; } } else { //Comment out this line to keep the color border around previously selected dialogue if (choice.transform.parent.GetComponent <Image>()) { choice.transform.parent.GetComponent <Image>().color = new Color(1f, 1f, 1f, 0f); } } }
public virtual void ShowResponse() { if (shownFeedback == null) { //If shown feedback is null, we are a child feedback. FeedbackScript parentScript = transform.parent.GetComponentInParent <FeedbackScript>(); shownFeedback = parentScript.shownFeedback; if (shownFeedbackBackground != null) { shownFeedbackBackground = parentScript.shownFeedbackBackground; } //If showing feedback shownFeedbackText = parentScript.shownFeedbackText; } shownFeedback.SetActive(true); UpdateColor(); UpdateText(); }
// Fade in void SetupFade() { fade = GameObject.Find("Fade").GetComponent <FadeScript>(); fade.FadeIn(); feedback = GameObject.Find("Feedback").GetComponent <FeedbackScript>(); }