- Home /
How I can set value of Dropdown?
Hi, experts.
I have options screen and I place dopdown on it to choose language of application.
After I read current options I have to set new value of my dropdown UI item.
.... public var dropdownOptionsSelectLang : UI.Selectable; ..... function SetUiOptions() { textOptionsVersionNum.text = db.stOptVersion;
if(db.stOptLanguage == "ENG") {
dropdownOptionsSelectLang.value = 0;
}
else {
dropdownOptionsSelectLang.value = 1;
}
};
When I change value in Inspector I see changes, but I have error in this code Assets/Scripts/WindowsAndNavigations.js(187,35): BCE0019: 'value' is not a member of 'UnityEngine.UI.Selectable'.
Could you help me?
Answer by flashframe · Feb 19, 2016 at 02:02 PM
You need to use UI.Dropdown when declaring your variable.
public var dropdownOptionsSelectLang : UI.Dropdown;
( The parent class UI.Selectable doesn't have a "value" variable)
Your answer
Follow this Question
Related Questions
New dropdown menu sample 3 Answers
Drop down style info panel 0 Answers
Setting Scroll View Width GUILayout 1 Answer