Answers for "selected value dropdown unity"

C#
1

get dropdown selected value unity

Debug.Log(Dropdown.options[Dropdown.value].text);
Posted by: Guest on August-13-2021
1

unity set dropdown value

IndexOf:

// returns a list of the text properties of the options
var listAvailableStrings = dropdown.options.Select(option => option.text).ToList();

// returns the index of the given string
dropdown.value = listAvailableStrings.IndexOf("an Option");

FindIndex

dropdown.value = dropdown.options.FindIndex(option => option.text == "an Option");
Posted by: Guest on June-28-2021

Code answers related to "selected value dropdown unity"

C# Answers by Framework

Browse Popular Code Answers by Language