This repository has been archived on 2023-09-13. You can view files and clone it, but cannot push or open issues or pull requests.
station_obscurum_unity/Assets/TextMesh Pro/Examples & Extras/Scripts/DropdownSample.cs

20 lines
507 B
C#
Raw Permalink Normal View History

2023-03-14 00:59:59 +01:00
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";
}
}