/// <summary> /// Keeps information on the menu up to date /// </summary> public void UpdateMenu() { MenuToDisplay menu = this.module.GetFixMenu(new MenuBuilder()); if (!String.IsNullOrEmpty(menu.Title)) { textContent.text = menu.Title; } int start = 0; int end = menu.MenuChoices.Count; if (menu.MenuChoices.Count > buttons.Count()) { end = buttons.Count(); } // Populate text for all buttons for (int i = start; i < end; i++) { var btnText = buttons[i].GetComponentInChildren <Text>(); btnText.text = menu.MenuChoices[i].DisplayName; this.addListener(i); buttons[i].gameObject.SetActive(true); } }
/// <summary> /// Keeps information on the menu up to date /// </summary> public void UpdateMenu() { MenuToDisplay menu = this.module.GetExpectedValuesPopup(new MenuBuilder()); if (!String.IsNullOrEmpty(menu.Title)) { this.texts[0].text = menu.Title; } int start = 0; int end = menu.MenuChoices.Count; var items = menu.GetAllAsStrings(); foreach (var item in items) { this.textContent.text += item.DisplayName + ": " + item.Value + "\n"; } this.textContent.text = this.textContent.text.Substring(0, this.textContent.text.Length - 1); // Remove the last newline }