コード例 #1
0
        public Dropdown AddDropdown(DropdownData dropdownData)
        {
            var dropdown = UserInterface.Instance.CreateDropdown(dropdownData);

            dropdown.transform.SetParent(this.inputs);

            return(dropdown);
        }
コード例 #2
0
        public Dropdown CreateDropdown(DropdownData dropdownData)
        {
            var dropdown = Instantiate(this.dropdownPrefab, this.canvas.transform, false);

            if (dropdownData.options != null)
            {
                dropdown.options = dropdownData.options;
            }

            if (dropdownData.onValueChanged != null)
            {
                dropdown.onValueChanged.AddListener(dropdownData.onValueChanged);
            }

            return(dropdown);
        }