diff options
| author | dereelatwit <54997325+dereelatwit@users.noreply.github.com> | 2023-08-03 14:05:08 -0400 |
|---|---|---|
| committer | dereelatwit <54997325+dereelatwit@users.noreply.github.com> | 2023-08-03 14:05:08 -0400 |
| commit | b8aa2e0935f309b112648f0352f35f5f33da946b (patch) | |
| tree | 9121ae1a65e483dddba8367cbbdd4991abfb3e26 /Pathfinding Visualizer/Assets/TextMesh Pro/Examples & Extras/Scripts/DropdownSample.cs | |
| parent | 374125ba34e0366afb062578906877cfdf229bb9 (diff) | |
started implementing UI
Diffstat (limited to 'Pathfinding Visualizer/Assets/TextMesh Pro/Examples & Extras/Scripts/DropdownSample.cs')
| -rw-r--r-- | Pathfinding Visualizer/Assets/TextMesh Pro/Examples & Extras/Scripts/DropdownSample.cs | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/Pathfinding Visualizer/Assets/TextMesh Pro/Examples & Extras/Scripts/DropdownSample.cs b/Pathfinding Visualizer/Assets/TextMesh Pro/Examples & Extras/Scripts/DropdownSample.cs new file mode 100644 index 0000000..f9ac60b --- /dev/null +++ b/Pathfinding Visualizer/Assets/TextMesh Pro/Examples & Extras/Scripts/DropdownSample.cs @@ -0,0 +1,19 @@ +using TMPro; +using UnityEngine; + +public class DropdownSample: MonoBehaviour +{ + [SerializeField] + private TextMeshProUGUI text = null; + + [SerializeField] + private TMP_Dropdown dropdownWithoutPlaceholder = null; + + [SerializeField] + private TMP_Dropdown dropdownWithPlaceholder = null; + + public void OnButtonClick() + { + text.text = dropdownWithPlaceholder.value > -1 ? "Selected values:\n" + dropdownWithoutPlaceholder.value + " - " + dropdownWithPlaceholder.value : "Error: Please make a selection"; + } +} |
