Global Game Jam 2022
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

19 lines
507 B

  1. using TMPro;
  2. using UnityEngine;
  3. public class DropdownSample: MonoBehaviour
  4. {
  5. [SerializeField]
  6. private TextMeshProUGUI text = null;
  7. [SerializeField]
  8. private TMP_Dropdown dropdownWithoutPlaceholder = null;
  9. [SerializeField]
  10. private TMP_Dropdown dropdownWithPlaceholder = null;
  11. public void OnButtonClick()
  12. {
  13. text.text = dropdownWithPlaceholder.value > -1 ? "Selected values:\n" + dropdownWithoutPlaceholder.value + " - " + dropdownWithPlaceholder.value : "Error: Please make a selection";
  14. }
  15. }