Answers for "How do you access the text value of the Dropdown UI?"http://answers.unity.com/questions/1167834/how-do-you-access-the-text-value-of-the-dropdown-u.html
The latest answers for the question "How do you access the text value of the Dropdown UI?"Answer by rsouzahttp://answers.unity.com/answers/1365998/view.html
You can simply do this:
Debug.Log(Dropdown.options[Dropdown.value].text);Thu, 15 Jun 2017 15:10:25 GMTrsouzaAnswer by No_Username_Foundhttp://answers.unity.com/answers/1321714/view.html
I couldn't get the above answers to work, so here is another (simpler) option for future readers:
//find your dropdown object
public Transform dropdownMenu;
//get the selected index
int menuIndex = dropdownMenu.GetComponent<Dropdown> ().value;
//get all options available within this dropdown menu
List<Dropdown.OptionData> menuOptions = dropdownMenu.GetComponent<Dropdown> ().options;
//get the string value of the selected index
string value = menuOptions [menuIndex].text;Sun, 05 Mar 2017 05:24:50 GMTNo_Username_FoundAnswer by AlvinHerawanhttp://answers.unity.com/answers/1167856/view.html
Turns out that the selected value is always reflected real time in the Text component of a child of the Dropdown, which is the Label. So here is what I had done:
var LocationPickerLabel : GameObject;
private var SelectedLocation : Text;
var LocName : String;
function Start () {
SelectedLocation = LocationPickerLabel.GetComponent(UI.Text);
LocName = SelectedLocation.text;}
A little out of topic, but I can also set the value from the start and therefore typing in an instruction before the drop down is pressed by typing SelectedLocation.text = "Any instruction that I need ..." in the start function.Fri, 08 Apr 2016 22:43:05 GMTAlvinHerawanAnswer by QuintonHhttp://answers.unity.com/answers/1167844/view.html
Try:
` LocPickerString = LocationPicker.GetComponent.<UI.Dropdown>().itemText.text`
Dropdown Documentation:
http://docs.unity3d.com/ScriptReference/UI.Dropdown.htmlFri, 08 Apr 2016 22:12:12 GMTQuintonH