Here the script I found from the forums but the problem is cann’t under this language can any convert this to javascript
List<List<object>> s_DropDownLists = new List<List<object>> ();
// ...
static bool DropDownList (bool open, List<object> list, ref int selectionIndex)
{
open = GUILayout.Toggle (open, List[selectionIndex].ToString (), GUI.skin.GetStyle ("TextField"));
if (open)
{
Rect dropDownRect = GUILayoutUtility.GetLastRect ();
dropDownRect = new Rect (dropDownRect.x, dropDownRect.y + dropDownRect.height, dropDownRect.width, dropDownRect.height * 3.0f);
list.Add (selectionIndex);
s_DropDownLists.Add (list);
GUI.Window (s_DropDownLists.Count - 1, dropDownRect, OnDropDownListGUI, GUI.skin.GetStyle ("Box"));
s_DropDownLists.RemoveAt (s_DropDownLists.Count - 1);
list.RemoveAt (list.Count - 1);
}
}
static void OnDropDownListGUI (int id)
{
List<object> list = s_DropDownLists[id];
for (int i = 0; i < list.Count - 1; i++)
{
if (GUILayout.Toggle (list[list.Count - 1] == i, list*.ToString (), GUI.skin.GetStyle ("Button")))*