Esempio n. 1
0
 public void SetMachineSelectable()
 {
     SelectedMachineDropdown.RefreshShownValue();
     //GUI_Debug("Changed Value");
     if (SelectedMachineDropdown.value != 0)
     {
         GUI_Debug("Set Machine: " + SelectedMachineDropdown.value);
         Interactor.SetSelectedMachine(SelectableMachines[SelectedMachineDropdown.value - 1]);
     }
     else
     {
         Interactor.SetSelectedMachine(null);
     }
 }
Esempio n. 2
0
 static int RefreshShownValue(IntPtr L)
 {
     LuaScriptMgr.CheckArgsCount(L, 1);
     UnityEngine.UI.Dropdown obj = (UnityEngine.UI.Dropdown)LuaScriptMgr.GetUnityObjectSelf(L, 1, "UnityEngine.UI.Dropdown");
     obj.RefreshShownValue();
     return(0);
 }
 static int RefreshShownValue(IntPtr L)
 {
     L.ChkArgsCount(1);
     UnityEngine.UI.Dropdown obj = (UnityEngine.UI.Dropdown)L.ChkUnityObjectSelf(1, "UnityEngine.UI.Dropdown");
     obj.RefreshShownValue();
     return(0);
 }
Esempio n. 4
0
 static public int RefreshShownValue(IntPtr l)
 {
     try {
                     #if DEBUG
         var    method     = System.Reflection.MethodBase.GetCurrentMethod();
         string methodName = GetMethodName(method);
                     #if UNITY_5_5_OR_NEWER
         UnityEngine.Profiling.Profiler.BeginSample(methodName);
                     #else
         Profiler.BeginSample(methodName);
                     #endif
                     #endif
         UnityEngine.UI.Dropdown self = (UnityEngine.UI.Dropdown)checkSelf(l);
         self.RefreshShownValue();
         pushValue(l, true);
         return(1);
     }
     catch (Exception e) {
         return(error(l, e));
     }
             #if DEBUG
     finally {
                     #if UNITY_5_5_OR_NEWER
         UnityEngine.Profiling.Profiler.EndSample();
                     #else
         Profiler.EndSample();
                     #endif
     }
             #endif
 }
Esempio n. 5
0
    public void FindParticipants()
    {
        UnityEngine.UI.Dropdown dropdown = GetComponent <UnityEngine.UI.Dropdown>();

        dropdown.ClearOptions();
        dropdown.AddOptions(new List <string>()
        {
            "Select participant", "New Participant"
        });

        string participantDirectory = manager.fileManager.ExperimentPath();

        if (Directory.Exists(participantDirectory))
        {
            string[]      filepaths = System.IO.Directory.GetDirectories(participantDirectory);
            List <string> filenames = new List <string>();

            for (int i = 0; i < filepaths.Length; i++)
            {
                if (manager.fileManager.isValidParticipant(System.IO.Path.GetFileName(filepaths[i])))
                {
                    filenames.Add(System.IO.Path.GetFileName(filepaths[i]));
                }
            }

            dropdown.AddOptions(filenames);
        }
        dropdown.value = 0;
        dropdown.RefreshShownValue();

        nextSessionNumber = 0;
        nextListNumber    = 0;
        UpdateTexts();
    }
Esempio n. 6
0
 public void UpdateStoryLevelDropdown()
 {
     // Add Levels
     PlayLevelDropDown.ClearOptions();
     PlayLevelDropDown.AddOptions(GameManager.Instance.Story.GetAvailableLevels());
     PlayLevelDropDown.RefreshShownValue();
 }
Esempio n. 7
0
    // Use this for initialization
    void Start()
    {
        Res = Screen.resolutions;

        resDropDown.ClearOptions();

        List <string> options = new List <string>();


        int currentScreenRes = 0;

        for (int x = 0; x < Res.Length; x++)
        {
            string option = Res[x].width + "+" + Res[x].height;
            options.Add(option);

            if (Res[x].width == Screen.currentResolution.width && Res[x].height == Screen.currentResolution.height)
            {
                currentScreenRes = x;
            }
        }
        resDropDown.AddOptions(options);
        resDropDown.value = currentScreenRes;
        resDropDown.RefreshShownValue();
    }
Esempio n. 8
0
    //****************************************************************************************************
    //
    //****************************************************************************************************

    private void SetupMapSources()
    {
        m_mapSources = (o.ui != null) ? o.ui.mapSources : null;

        if (m_mapSources != null)
        {
            m_mapSources.ClearOptions();

            int nbSources = System.Enum.GetValues(typeof(WebMap.SOURCE)).Length;

            for (int source = 0; source < nbSources; ++source)
            {
                m_mapSources.options.Add(new UnityEngine.UI.Dropdown.OptionData(((WebMap.SOURCE)source).ToString()));
            }


            m_mapSources.onValueChanged.RemoveAllListeners();

            m_mapSources.onValueChanged.AddListener(delegate { OnMapSourceSelected(); });

            m_mapSources.value = ( int )((m_map != null) ? m_map.source : WebMap.DEFAULT_SOURCE);

            m_mapSources.RefreshShownValue();
        }
    }
Esempio n. 9
0
 static public int RefreshShownValue(IntPtr l)
 {
     try {
         UnityEngine.UI.Dropdown self = (UnityEngine.UI.Dropdown)checkSelf(l);
         self.RefreshShownValue();
         return(0);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
Esempio n. 10
0
 private void refreshReceiveIPDropdown()
 {
     receiveIP.options.Clear();
     foreach (string s in Presenter.Instance.getOriginIPsString())
     {
         receiveIP.options.Add(new UnityEngine.UI.Dropdown.OptionData()
         {
             text = s
         });
     }
     receiveIP.RefreshShownValue();
 }
Esempio n. 11
0
 public void fileDialogSendFile(int index)
 {
     Debug.Log(dropdown.value);
     if (index > 0)
     {
         GameController.GameControllerInstance.sendDialogResult(dropdown.options[index].text);
     }
     dropdown.value = 0;
     dropdown.Select();
     dropdown.RefreshShownValue();
     //gameObject.SetActive(false);
 }
 static int QPYX_RefreshShownValue_YXQP(IntPtr L_YXQP)
 {
     try
     {
         ToLua.CheckArgsCount(L_YXQP, 1);
         UnityEngine.UI.Dropdown QPYX_obj_YXQP = (UnityEngine.UI.Dropdown)ToLua.CheckObject <UnityEngine.UI.Dropdown>(L_YXQP, 1);
         QPYX_obj_YXQP.RefreshShownValue();
         return(0);
     }
     catch (Exception e_YXQP)                {
         return(LuaDLL.toluaL_exception(L_YXQP, e_YXQP));
     }
 }
Esempio n. 13
0
    //****************************************************************************************************
    //
    //****************************************************************************************************

    public void ConfigureDropDownLists()
    {
        if (m_coordsSys != null)
        {
            m_coordsSys.ClearOptions();

            m_coordsSys.options.Add(new UnityEngine.UI.Dropdown.OptionData("WGS_84"));

            m_coordsSys.options.Add(new UnityEngine.UI.Dropdown.OptionData("LAMBERT_93"));

            m_coordsSys.value = 0;

            m_coordsSys.RefreshShownValue();
        }


        for (int row = 0; row < ( int )CSV.COL.NB; ++row)
        {
            UnityEngine.UI.Dropdown d = m_dropDowns[row];

            if (d == null)
            {
                continue;
            }

            d.ClearOptions();

            d.options.Add(new UnityEngine.UI.Dropdown.OptionData("SELECT"));

            for (int col = 0; col < m_header.Length; ++col)
            {
                d.options.Add(new UnityEngine.UI.Dropdown.OptionData(m_header[col]));
            }

            d.value = 0;

            d.RefreshShownValue();
        }
    }
 static int RefreshShownValue(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 1);
         UnityEngine.UI.Dropdown obj = (UnityEngine.UI.Dropdown)ToLua.CheckObject(L, 1, typeof(UnityEngine.UI.Dropdown));
         obj.RefreshShownValue();
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
Esempio n. 15
0
    public void UpdateCustomLevelDropdown()
    {
        customLevels = new List <string>();
        foreach (string file in System.IO.Directory.GetFiles("Levels/Custom/"))
        {
            string name = file.Replace("Levels/Custom/", "");
            name = name.Replace(".xml", "");
            customLevels.Add(name);
        }

        // Add Levels
        CustomLevelDropDown.ClearOptions();
        CustomLevelDropDown.AddOptions(customLevels);
        CustomLevelDropDown.RefreshShownValue();
    }
Esempio n. 16
0
 private void LoadBundles()
 {
     string[] bundles = System.IO.Directory.GetDirectories(WWWLoader.full_download_path);
     UnityEngine.UI.Dropdown dropdown = GameObject.Find("ActiveBundle Dropdown").GetComponent <UnityEngine.UI.Dropdown>();
     dropdown.ClearOptions();
     foreach (string bundle in bundles)
     {
         if (bundle.EndsWith(".sky"))
         {
             string bundlename = System.IO.Path.GetFileNameWithoutExtension(bundle);
             dropdown.options.Add(new UnityEngine.UI.Dropdown.OptionData(bundlename));
         }
     }
     dropdown.RefreshShownValue();
 }
Esempio n. 17
0
    //****************************************************************************************************
    //
    //****************************************************************************************************

    private void BuildSitesList(Localizable target)
    {
        if (m_sites == null)
        {
            return;
        }


        Site site = (target is Site) ? target as Site : null;

        Item item = (target is Item) ? target as Item : null;

        m_sites.ClearOptions();

        m_sites.value = 0;

        m_sites.interactable = (item != null) && (DBObjects.instance != null);



        if (m_sites.interactable)
        {
            m_sites.options.Add(new UnityEngine.UI.Dropdown.OptionData("NONE"));

            for (int siteIndex = 0; siteIndex < DBObjects.instance.sites.Count; ++siteIndex)
            {
                m_sites.options.Add(new UnityEngine.UI.Dropdown.OptionData(DBObjects.instance.sites[siteIndex].name));

                if (item.parentID == DBObjects.instance.sites[siteIndex].id)
                {
                    m_sites.value = siteIndex + 1;
                }
            }

            m_sites.RefreshShownValue();
        }
        else
        {
            m_sites.captionText.text = (site != null) ? site.name : string.Empty;
        }
    }
Esempio n. 18
0
    public void OnTangoPermissions(bool permissionsGranted)
    {
        // AndroidHelper.StartTangoPermissionsActivity("Dataset Read/Write");

        dropdown.options.Clear();
        if (!permissionsGranted)
        {
            return;
        }
        dropdown.options.Add(new Dropdown.OptionData {
            text = "No ADF"
        });
        list = AreaDescription.GetList();
        if (list != null)
        {
            foreach (AreaDescription ad in list)
            {
                dropdown.options.Add(new Dropdown.OptionData(ad.GetMetadata().m_name + "_" + ad.m_uuid));
            }
        }
        dropdown.RefreshShownValue();
    }
Esempio n. 19
0
    //****************************************************************************************************
    //
    //****************************************************************************************************

    private void ReflectOptions()
    {
        if (m_coordsSys != null)
        {
            m_coordsSys.value = ( int )m_options.coords;

            m_coordsSys.RefreshShownValue();
        }


        for (int row = 0; row < ( int )CSV.COL.NB; ++row)
        {
            UnityEngine.UI.Dropdown d = m_dropDowns[row];

            if (d == null)
            {
                continue;
            }

            d.value = (row < m_header.Length) ? (m_options.cols[row] + 1) : 0;

            d.RefreshShownValue();
        }
    }
Esempio n. 20
0
    void Start()
    {
        m_ParticleSystem.Initialize();
        m_Integrator.Initialize(m_ParticleSystem);
        m_IntegratorDropdown = GameObject.Find("IntegratorDropdown").GetComponent <UnityEngine.UI.Dropdown>();
        if (m_Integrator is EulerIntegrator)
        {
            m_IntegratorDropdown.value = 0;
        }
        else if (m_Integrator is MidpointIntegrator)
        {
            m_IntegratorDropdown.value = 1;
        }
        else if (m_Integrator is LeapfrogIntegrator)
        {
            m_IntegratorDropdown.value = 2;
        }
        else if (m_Integrator is RungeKutta4Integrator)
        {
            m_IntegratorDropdown.value = 3;
        }
        else if (m_Integrator is VerletIntegrator)
        {
            m_IntegratorDropdown.value = 4;
        }
        else if (m_Integrator is MidpointVerletIntegrator)
        {
            m_IntegratorDropdown.value = 5;
        }

        m_IntegratorDropdown.RefreshShownValue();

        m_ScenarioDropdown = GameObject.Find("ScenarioDropdown").GetComponent <UnityEngine.UI.Dropdown>();
        if (m_Scenario is TestScenario)
        {
            m_ScenarioDropdown.value = 0;
        }
        else if (m_Scenario is HairScenario)
        {
            m_ScenarioDropdown.value = 1;
        }
        else if (m_Scenario is ClothScenario)
        {
            m_ScenarioDropdown.value = 2;
        }
        else if (m_Scenario is CirclesAndSpringsScenario)
        {
            m_ScenarioDropdown.value = 3;
        }
        else if (m_Scenario is TrainScenario)
        {
            m_ScenarioDropdown.value = 4;
        }
        else if (m_Scenario is PendulumScenario)
        {
            m_ScenarioDropdown.value = 5;
        }
        else if (m_Scenario is DualCircleScenario)
        {
            m_ScenarioDropdown.value = 6;
        }
        else if (m_Scenario is ElipticalEngineScenario)
        {
            m_ScenarioDropdown.value = 7;
        }
        else if (m_Scenario is SlicedEllipseScenario)
        {
            m_ScenarioDropdown.value = 8;
        }
        else if (m_Scenario is ReversibleScenario)
        {
            m_ScenarioDropdown.value = 9;
        }
        else if (m_Scenario is SpeedTestScenario)
        {
            m_ScenarioDropdown.value = 10;
        }
        m_ScenarioDropdown.RefreshShownValue();

        m_CircleDropdown = GameObject.Find("CircleDropdown").GetComponent <UnityEngine.UI.Dropdown>();
        if (CircularWireConstraint.OLD)
        {
            m_CircleDropdown.value = 0;
        }
        else
        {
            m_CircleDropdown.value = 1;
        }

        m_CircleDropdown.RefreshShownValue();

        m_RodDropdown = GameObject.Find("RodDropdown").GetComponent <UnityEngine.UI.Dropdown>();
        if (RodConstraint.OLD)
        {
            m_RodDropdown.value = 0;
        }
        else
        {
            m_RodDropdown.value = 1;
        }

        m_CircleDropdown.RefreshShownValue();

        m_AngleDropdown = GameObject.Find("AngleDropdown").GetComponent <UnityEngine.UI.Dropdown>();
        if (AngularSpringForce.INIT_AD_HOC)
        {
            m_AngleDropdown.value = 0;
        }
        else
        {
            m_AngleDropdown.value = 1;
        }

        m_CircleDropdown.RefreshShownValue();

        m_SolverDropdown       = GameObject.Find("SolverDropdown").GetComponent <UnityEngine.UI.Dropdown>();
        m_SolverDropdown.value = 1; // CG2 default

        m_SimulationFlowToggle = GameObject.Find("ReverseSimulationToggle").GetComponent <UnityEngine.UI.Toggle>();
        m_SpeedSlider          = GameObject.Find("SpeedSlider").GetComponent <UnityEngine.UI.Slider>();
        m_SpeedSliderText      = m_SpeedSlider.GetComponentInChildren <UnityEngine.UI.Text>();
        m_SpeedSlider.value    = Mathf.Clamp(m_Speed, 0.01f, 5f);
        m_SpeedSliderText.text = m_Speed + "x";
    }
Esempio n. 21
0
        /// <summary>
        /// Create the basic UI dropdown.
        /// </summary>
        /// <remarks>
        /// Hierarchy:
        /// (root)
        ///     Dropdown
        ///         - Label
        ///         - Arrow
        ///         - Template
        ///             - Viewport
        ///                 - Content
        ///                     - Item
        ///                         - Item Background
        ///                         - Item Checkmark
        ///                         - Item Label
        ///             - Scrollbar
        ///                 - Sliding Area
        ///                     - Handle
        /// </remarks>
        /// <param name="resources">The resources to use for creation.</param>
        /// <returns>The root GameObject of the created element.</returns>
        public static GameObject CreateDropdown(Resources resources)
        {
            GameObject root = CreateUIElementRoot("Dropdown", s_ThickElementSize);

            GameObject label          = CreateUIObject("Label", root);
            GameObject arrow          = CreateUIObject("Arrow", root);
            GameObject template       = CreateUIObject("Template", root);
            GameObject viewport       = CreateUIObject("Viewport", template);
            GameObject content        = CreateUIObject("Content", viewport);
            GameObject item           = CreateUIObject("Item", content);
            GameObject itemBackground = CreateUIObject("Item Background", item);
            GameObject itemCheckmark  = CreateUIObject("Item Checkmark", item);
            GameObject itemLabel      = CreateUIObject("Item Label", item);

            // Sub controls.

            GameObject scrollbar = CreateScrollbar(resources);

            scrollbar.name = "Scrollbar";
            SetParentAndAlign(scrollbar, template);

            Scrollbar scrollbarScrollbar = scrollbar.GetComponent <Scrollbar>();

            scrollbarScrollbar.SetDirection(Scrollbar.Direction.BottomToTop, true);

            RectTransform vScrollbarRT = scrollbar.GetComponent <RectTransform>();

            vScrollbarRT.anchorMin = Vector2.right;
            vScrollbarRT.anchorMax = Vector2.one;
            vScrollbarRT.pivot     = Vector2.one;
            vScrollbarRT.sizeDelta = new Vector2(vScrollbarRT.sizeDelta.x, 0);

            // Setup item UI components.

            Text itemLabelText = itemLabel.AddComponent <Text>();

            SetDefaultTextValues(itemLabelText);
            itemLabelText.alignment = TextAnchor.MiddleLeft;

            Image itemBackgroundImage = itemBackground.AddComponent <Image>();

            itemBackgroundImage.color = new Color32(245, 245, 245, 255);

            Image itemCheckmarkImage = itemCheckmark.AddComponent <Image>();

            itemCheckmarkImage.sprite = resources.checkmark;

            Toggle itemToggle = item.AddComponent <Toggle>();

            itemToggle.targetGraphic = itemBackgroundImage;
            itemToggle.graphic       = itemCheckmarkImage;
            itemToggle.isOn          = true;

            // Setup template UI components.

            Image templateImage = template.AddComponent <Image>();

            templateImage.sprite = resources.standard;
            templateImage.type   = Image.Type.Sliced;

            ScrollRect templateScrollRect = template.AddComponent <ScrollRect>();

            templateScrollRect.content                     = (RectTransform)content.transform;
            templateScrollRect.viewport                    = (RectTransform)viewport.transform;
            templateScrollRect.horizontal                  = false;
            templateScrollRect.movementType                = ScrollRect.MovementType.Clamped;
            templateScrollRect.verticalScrollbar           = scrollbarScrollbar;
            templateScrollRect.verticalScrollbarVisibility = ScrollRect.ScrollbarVisibility.AutoHideAndExpandViewport;
            templateScrollRect.verticalScrollbarSpacing    = -3;

            Mask scrollRectMask = viewport.AddComponent <Mask>();

            scrollRectMask.showMaskGraphic = false;

            Image viewportImage = viewport.AddComponent <Image>();

            viewportImage.sprite = resources.mask;
            viewportImage.type   = Image.Type.Sliced;

            // Setup dropdown UI components.

            Text labelText = label.AddComponent <Text>();

            SetDefaultTextValues(labelText);
            labelText.alignment = TextAnchor.MiddleLeft;

            Image arrowImage = arrow.AddComponent <Image>();

            arrowImage.sprite = resources.dropdown;

            Image backgroundImage = root.AddComponent <Image>();

            backgroundImage.sprite = resources.standard;
            backgroundImage.color  = s_DefaultSelectableColor;
            backgroundImage.type   = Image.Type.Sliced;

            Dropdown dropdown = root.AddComponent <Dropdown>();

            dropdown.targetGraphic = backgroundImage;
            SetDefaultColorTransitionValues(dropdown);
            dropdown.template    = template.GetComponent <RectTransform>();
            dropdown.captionText = labelText;
            dropdown.itemText    = itemLabelText;

            // Setting default Item list.
            itemLabelText.text = "Option A";
            dropdown.options.Add(new Dropdown.OptionData {
                text = "Option A"
            });
            dropdown.options.Add(new Dropdown.OptionData {
                text = "Option B"
            });
            dropdown.options.Add(new Dropdown.OptionData {
                text = "Option C"
            });
            dropdown.RefreshShownValue();

            // Set up RectTransforms.

            RectTransform labelRT = label.GetComponent <RectTransform>();

            labelRT.anchorMin = Vector2.zero;
            labelRT.anchorMax = Vector2.one;
            labelRT.offsetMin = new Vector2(10, 6);
            labelRT.offsetMax = new Vector2(-25, -7);

            RectTransform arrowRT = arrow.GetComponent <RectTransform>();

            arrowRT.anchorMin        = new Vector2(1, 0.5f);
            arrowRT.anchorMax        = new Vector2(1, 0.5f);
            arrowRT.sizeDelta        = new Vector2(20, 20);
            arrowRT.anchoredPosition = new Vector2(-15, 0);

            RectTransform templateRT = template.GetComponent <RectTransform>();

            templateRT.anchorMin        = new Vector2(0, 0);
            templateRT.anchorMax        = new Vector2(1, 0);
            templateRT.pivot            = new Vector2(0.5f, 1);
            templateRT.anchoredPosition = new Vector2(0, 2);
            templateRT.sizeDelta        = new Vector2(0, 150);

            RectTransform viewportRT = viewport.GetComponent <RectTransform>();

            viewportRT.anchorMin = new Vector2(0, 0);
            viewportRT.anchorMax = new Vector2(1, 1);
            viewportRT.sizeDelta = new Vector2(-18, 0);
            viewportRT.pivot     = new Vector2(0, 1);

            RectTransform contentRT = content.GetComponent <RectTransform>();

            contentRT.anchorMin        = new Vector2(0f, 1);
            contentRT.anchorMax        = new Vector2(1f, 1);
            contentRT.pivot            = new Vector2(0.5f, 1);
            contentRT.anchoredPosition = new Vector2(0, 0);
            contentRT.sizeDelta        = new Vector2(0, 28);

            RectTransform itemRT = item.GetComponent <RectTransform>();

            itemRT.anchorMin = new Vector2(0, 0.5f);
            itemRT.anchorMax = new Vector2(1, 0.5f);
            itemRT.sizeDelta = new Vector2(0, 20);

            RectTransform itemBackgroundRT = itemBackground.GetComponent <RectTransform>();

            itemBackgroundRT.anchorMin = Vector2.zero;
            itemBackgroundRT.anchorMax = Vector2.one;
            itemBackgroundRT.sizeDelta = Vector2.zero;

            RectTransform itemCheckmarkRT = itemCheckmark.GetComponent <RectTransform>();

            itemCheckmarkRT.anchorMin        = new Vector2(0, 0.5f);
            itemCheckmarkRT.anchorMax        = new Vector2(0, 0.5f);
            itemCheckmarkRT.sizeDelta        = new Vector2(20, 20);
            itemCheckmarkRT.anchoredPosition = new Vector2(10, 0);

            RectTransform itemLabelRT = itemLabel.GetComponent <RectTransform>();

            itemLabelRT.anchorMin = Vector2.zero;
            itemLabelRT.anchorMax = Vector2.one;
            itemLabelRT.offsetMin = new Vector2(20, 1);
            itemLabelRT.offsetMax = new Vector2(-10, -2);

            template.SetActive(false);

            return(root);
        }
Esempio n. 22
0
        public static GameObject CreateDropdown(DefaultControls.Resources resources)
        {
            GameObject gameObject   = DefaultControls.CreateUIElementRoot("Dropdown", DefaultControls.s_ThickElementSize);
            GameObject gameObject2  = DefaultControls.CreateUIObject("Label", gameObject);
            GameObject gameObject3  = DefaultControls.CreateUIObject("Arrow", gameObject);
            GameObject gameObject4  = DefaultControls.CreateUIObject("Template", gameObject);
            GameObject gameObject5  = DefaultControls.CreateUIObject("Viewport", gameObject4);
            GameObject gameObject6  = DefaultControls.CreateUIObject("Content", gameObject5);
            GameObject gameObject7  = DefaultControls.CreateUIObject("Item", gameObject6);
            GameObject gameObject8  = DefaultControls.CreateUIObject("Item Background", gameObject7);
            GameObject gameObject9  = DefaultControls.CreateUIObject("Item Checkmark", gameObject7);
            GameObject gameObject10 = DefaultControls.CreateUIObject("Item Label", gameObject7);
            GameObject gameObject11 = DefaultControls.CreateScrollbar(resources);

            gameObject11.name = "Scrollbar";
            DefaultControls.SetParentAndAlign(gameObject11, gameObject4);
            Scrollbar component = gameObject11.GetComponent <Scrollbar>();

            component.SetDirection(Scrollbar.Direction.BottomToTop, true);
            RectTransform component2 = gameObject11.GetComponent <RectTransform>();

            component2.anchorMin = Vector2.right;
            component2.anchorMax = Vector2.one;
            component2.pivot     = Vector2.one;
            component2.sizeDelta = new Vector2(component2.sizeDelta.x, 0f);
            Text text = gameObject10.AddComponent <Text>();

            DefaultControls.SetDefaultTextValues(text);
            text.alignment = TextAnchor.MiddleLeft;
            Image image = gameObject8.AddComponent <Image>();

            image.color = new Color32(245, 245, 245, 255);
            Image image2 = gameObject9.AddComponent <Image>();

            image2.sprite = resources.checkmark;
            Toggle toggle = gameObject7.AddComponent <Toggle>();

            toggle.targetGraphic = image;
            toggle.graphic       = image2;
            toggle.isOn          = true;
            Image image3 = gameObject4.AddComponent <Image>();

            image3.sprite = resources.standard;
            image3.type   = Image.Type.Sliced;
            ScrollRect scrollRect = gameObject4.AddComponent <ScrollRect>();

            scrollRect.content                     = (RectTransform)gameObject6.transform;
            scrollRect.viewport                    = (RectTransform)gameObject5.transform;
            scrollRect.horizontal                  = false;
            scrollRect.movementType                = ScrollRect.MovementType.Clamped;
            scrollRect.verticalScrollbar           = component;
            scrollRect.verticalScrollbarVisibility = ScrollRect.ScrollbarVisibility.AutoHideAndExpandViewport;
            scrollRect.verticalScrollbarSpacing    = -3f;
            Mask mask = gameObject5.AddComponent <Mask>();

            mask.showMaskGraphic = false;
            Image image4 = gameObject5.AddComponent <Image>();

            image4.sprite = resources.mask;
            image4.type   = Image.Type.Sliced;
            Text text2 = gameObject2.AddComponent <Text>();

            DefaultControls.SetDefaultTextValues(text2);
            text2.alignment = TextAnchor.MiddleLeft;
            Image image5 = gameObject3.AddComponent <Image>();

            image5.sprite = resources.dropdown;
            Image image6 = gameObject.AddComponent <Image>();

            image6.sprite = resources.standard;
            image6.color  = DefaultControls.s_DefaultSelectableColor;
            image6.type   = Image.Type.Sliced;
            Dropdown dropdown = gameObject.AddComponent <Dropdown>();

            dropdown.targetGraphic = image6;
            DefaultControls.SetDefaultColorTransitionValues(dropdown);
            dropdown.template    = gameObject4.GetComponent <RectTransform>();
            dropdown.captionText = text2;
            dropdown.itemText    = text;
            text.text            = "Option A";
            dropdown.options.Add(new Dropdown.OptionData
            {
                text = "Option A"
            });
            dropdown.options.Add(new Dropdown.OptionData
            {
                text = "Option B"
            });
            dropdown.options.Add(new Dropdown.OptionData
            {
                text = "Option C"
            });
            dropdown.RefreshShownValue();
            RectTransform component3 = gameObject2.GetComponent <RectTransform>();

            component3.anchorMin = Vector2.zero;
            component3.anchorMax = Vector2.one;
            component3.offsetMin = new Vector2(10f, 6f);
            component3.offsetMax = new Vector2(-25f, -7f);
            RectTransform component4 = gameObject3.GetComponent <RectTransform>();

            component4.anchorMin        = new Vector2(1f, 0.5f);
            component4.anchorMax        = new Vector2(1f, 0.5f);
            component4.sizeDelta        = new Vector2(20f, 20f);
            component4.anchoredPosition = new Vector2(-15f, 0f);
            RectTransform component5 = gameObject4.GetComponent <RectTransform>();

            component5.anchorMin        = new Vector2(0f, 0f);
            component5.anchorMax        = new Vector2(1f, 0f);
            component5.pivot            = new Vector2(0.5f, 1f);
            component5.anchoredPosition = new Vector2(0f, 2f);
            component5.sizeDelta        = new Vector2(0f, 150f);
            RectTransform component6 = gameObject5.GetComponent <RectTransform>();

            component6.anchorMin = new Vector2(0f, 0f);
            component6.anchorMax = new Vector2(1f, 1f);
            component6.sizeDelta = new Vector2(-18f, 0f);
            component6.pivot     = new Vector2(0f, 1f);
            RectTransform component7 = gameObject6.GetComponent <RectTransform>();

            component7.anchorMin        = new Vector2(0f, 1f);
            component7.anchorMax        = new Vector2(1f, 1f);
            component7.pivot            = new Vector2(0.5f, 1f);
            component7.anchoredPosition = new Vector2(0f, 0f);
            component7.sizeDelta        = new Vector2(0f, 28f);
            RectTransform component8 = gameObject7.GetComponent <RectTransform>();

            component8.anchorMin = new Vector2(0f, 0.5f);
            component8.anchorMax = new Vector2(1f, 0.5f);
            component8.sizeDelta = new Vector2(0f, 20f);
            RectTransform component9 = gameObject8.GetComponent <RectTransform>();

            component9.anchorMin = Vector2.zero;
            component9.anchorMax = Vector2.one;
            component9.sizeDelta = Vector2.zero;
            RectTransform component10 = gameObject9.GetComponent <RectTransform>();

            component10.anchorMin        = new Vector2(0f, 0.5f);
            component10.anchorMax        = new Vector2(0f, 0.5f);
            component10.sizeDelta        = new Vector2(20f, 20f);
            component10.anchoredPosition = new Vector2(10f, 0f);
            RectTransform component11 = gameObject10.GetComponent <RectTransform>();

            component11.anchorMin = Vector2.zero;
            component11.anchorMax = Vector2.one;
            component11.offsetMin = new Vector2(20f, 1f);
            component11.offsetMax = new Vector2(-10f, -2f);
            gameObject4.SetActive(false);
            return(gameObject);
        }