public static void ShowFeedback(FeedbackEntry[] feedback) { if (feedback.Length == 0) { return; } foreach (var fb in feedback) { if (fb.Type == FeedbackType.Technical) { if (fb.Text.ToLower() == "clear") { Clear(); Clear(); //dunno why we have to do that... Unity... } else if (fb.Text.ToLower().StartsWith("entersection")) { ShowFeedback(Send( GameEventBuilder.EnterSection(fb.Text.Split(':')[1]) )); } else if (fb.Text.ToLower() == "cleartext") { Instance.defaultText(); } } else if (fb.IsQuestion) { string text = fb.Text.Contains(";") ? fb.Text.Split(';').Aggregate((prev, curr) => LanguageManager.Instance.GetString(prev.Trim()) + " " + LanguageManager.Instance.GetString(curr.Trim())) : LanguageManager.Instance.GetString(fb.Text); var args = new TaskEntryManager.AddElementArguments() { Inputs = fb.Inputs, Text = text, SendHandler = ButtonSendPressed, }; Instance.TEM.AddElement(args); } else { ShowText(fb); } } }
private void Awake() { Instance = this; TEM = AssignmentSheet.GetComponent <TaskEntryManager>(); lastSet = DateTime.Now; if (AssignmentSheet == null || TEM == null) { throw new InvalidProgramException("The given Assignment Sheet is not valid. It must contain a TaskEntryManager component."); } InfoText.transform.parent.Find("Button").GetComponent <Button>().onClick.AddListener(delegate { Instance.defaultText(); }); }