I have been searching for an answer to this question for a bit and have come up with nothing that works. I am attempting to populate a Dropdown list with data I have retrieved from a database. The data is a list of strings called profiles. I have tried this code
List profiles;
profiles = DbFunctions.GetProfileData();
GameObject obj = GameObject.Find("UserNameDropdown");
obj.GetComponent().options.Add(profiles);
The DbFunctions.GetProfileData(); retrieves the data from the database and is working fine , the question is what is the correct way to add these values to the dropdown list? The error I am seeing with the above code is
cannot convert from ‘System.Collections.Generic.List’ to ‘UnityEngine.UI.Dropdown.OptionData’
Any help or guidance would be appreciated.