Ejemplo n.º 1
0
    // Use this for initialization
    void Start()
    {
        GameObject dropper = GameObject.FindWithTag ("TypeSelect");
        if(dropper == null) Debug.Log("Cannot find type select dropdown list");
        else typeSelect = dropper.GetComponent<Dropdown>();

        dropper = GameObject.FindWithTag ("MoveList");
        if(dropper == null) Debug.Log("Cannot find Move List dropdown list");
        else moveList = dropper.GetComponent<Dropdown>();

        GameObject temp = GameObject.FindWithTag ("Size");
        if(temp == null) Debug.Log("Cannot find Size text");
        else size = temp.GetComponent<Text>();

        temp = GameObject.FindWithTag ("Weight");
        if(temp == null) Debug.Log("Cannot find Weight text");
        else weight = temp.GetComponent<Text>();

        pokeData = GameObject.FindWithTag ("PokeData");
        if(pokeData == null) Debug.Log("Cannot find PokeData Gameobject");
        else
        {
            movesPollFlag = false;
            dataPollFlag = false;
        }

        foreach(string str in types)
        {
            typeSelect.options.Add(new Dropdown.OptionData(str, null));
        }
    }
Ejemplo n.º 2
0
    /*
     * /BORDERLESS
     * 
     */


	// Use this for initialization
	void Start () {
        qualitySettings = transform.Find("QualitySettings").GetComponent<Dropdown>();
        resolutionSettings = transform.Find("Resolutions").GetComponent<Dropdown>();
        debugText = transform.Find("DEBUG").GetComponent<Text>();
        windowSettings = transform.Find("WindowSettings").GetComponent<Dropdown>();
        SetupInterface();
	}
Ejemplo n.º 3
0
	public void getValue(Dropdown target)
	{
		Debug.Log (string.Format (target.value.ToString()));

		GameObject imageDisplay = GameObject.Find ("mapImage");

	}
    void Start()
    {
        dropdown = GetComponent<Dropdown>();
        LanguageManager.Instance.OnChangeLanguage += OnLanguageChanged;

        OnLanguageChanged(LanguageManager.Instance);
    }
Ejemplo n.º 5
0
    void Start()
    {
        _data = GetComponent<Dropdown>();
        if (_type == PrinterName)
        {
            if (!PrintDevice.isValid)
            {
                throw new NotSupportedException("認識できるプリンターがありません");
            }
            var printer = PrintDevice.GetPrinterNames().GetEnumerator();
            while (printer.MoveNext())
            {
                _item = new Dropdown.OptionData();
                _item.text = printer.Current;
                _data.options.Add(_item);
            }
            _data.captionText.text = _data.options[0].text;

        }
        else if (_type == PrinterColor)
        {
            var color = _offScreenCamera.GetComponent<Grayscale>();
            if (_data.value == 0)
            {
                _printColor = PrintDevice.GetPrinterColorConfig(true);
                color.enabled = false;
            }
            else if (_data.value == 1)
            {
                _printColor = PrintDevice.GetPrinterColorConfig(false);
                color.enabled = true;
            }
        }
    }
Ejemplo n.º 6
0
    void Start()
    {
        wepControl = GameObject.Find ("Player").GetComponent<PlayerWepControl> ();
        spellControl = GameObject.Find ("Player").GetComponent<PlayerSpellControl> ();
        mover = GameObject.Find ("Player").GetComponent<PlayerMove> ();
        wepSize = GameObject.Find ("Player").GetComponent<WeaponSize> ();
        mouseLook = GameObject.Find ("Player").GetComponentInChildren<SimpleSmoothMouseLook> ();

        bladeRenderer = GameObject.Find ("Player").transform.Find ("CharacterHead").Find ("RightWep").Find ("RightWepBlade").GetComponent<Renderer>();
        handleRenderer = GameObject.Find ("Player").transform.Find ("CharacterHead").Find ("RightWep").Find ("RightWepHandle").GetComponent<Renderer>();

        headSlider = transform.Find ("HeadSizeSlider").GetComponent<Slider> ();
        handleSlider = transform.Find ("HandleSizeSlider").GetComponent<Slider> ();
        typeDrop = transform.Find ("TypeDropdown").GetComponent<Dropdown> ();
        statText = transform.Find ("StatIndicator").GetComponent<Text> ();

        Transform colorStuff = transform.Find ("ColorCustomizers");

        bladeRedSlider = colorStuff.Find ("BladeRedSlider").GetComponent<Slider>();
        bladeGreenSlider = colorStuff.Find ("BladeGreenSlider").GetComponent<Slider>();
        bladeBlueSlider = colorStuff.Find ("BladeBlueSlider").GetComponent<Slider>();
        bladeColorImage = colorStuff.Find ("BladeColorImage").GetComponent<Image>();

        handleRedSlider = colorStuff.Find ("HandleRedSlider").GetComponent<Slider>();
        handleGreenSlider = colorStuff.Find ("HandleGreenSlider").GetComponent<Slider>();
        handleBlueSlider = colorStuff.Find ("HandleBlueSlider").GetComponent<Slider>();
        handleColorImage = colorStuff.Find ("HandleColorImage").GetComponent<Image>();
    }
Ejemplo n.º 7
0
 private void onTypeValueChanged(Dropdown drop)
 {
     if (selectedTile != null)
     {
         selectedTile.SetTileType((HexTileTypes)drop.value);
     }
 }
Ejemplo n.º 8
0
 // Use this for initialization
 void Start()
 {
     drop = this.gameObject.gameObject.GetComponent<Dropdown> ();
     drop.onValueChanged.AddListener (delegate {
         valueChanged (drop);
     });
 }
Ejemplo n.º 9
0
	// Use this for initialization
	void Awake () {
        levelManager = GameObject.Find("LevelManager").GetComponent<LevelManager>();
        characterNameText = GameObject.Find("CharacterNameText").GetComponent<Text>();
        playerNameText = GameObject.Find("PlayerNameText").GetComponent<Text>();
        speciesText = GameObject.Find("SpeciesText").GetComponent<Text>();
        careerDropdown = GameObject.Find("CareerDropdown").GetComponent<Dropdown>();
        specDropdown = GameObject.Find("SpecDropdown").GetComponent<Dropdown>();
        nextButton = GameObject.Find("NextStepButton").GetComponent<Button>();
        
        careerDescription = GameObject.Find("CareerDescriptionContent").GetComponent<Text>();
        primarySpecDescription = GameObject.Find("PrimarySpecDescriptionContent").GetComponent<Text>();
        careerSkillsText = GameObject.Find("CareerSkillsText").GetComponent<Text>();
        bonusCareerSkillsText = GameObject.Find("BonusCareerSkillsText").GetComponent<Text>();
        
        careerImage = GameObject.Find("CareerImage").GetComponent<Image>();
        specImage = GameObject.Find("SpecImage").GetComponent<Image>();

        characterNameText.text = CharacterInformation.CharacterName;        
        playerNameText.text = CharacterInformation.PlayerName;
        speciesText.text = CharacterInformation.CharacterSpecies.SpeciesName;
        /*if (CharacterInformation.CharacterCareer != null)
        {
            SetCareerCombo(CharacterInformation.CharacterCareer);
        }*/

        FillCareerDropdown();
        /*if (CharacterInformation.characterSpecList.Count != 0)
        {
            SetSpecCombo(CharacterInformation.characterSpecList[0]);
        }*/
        
	}
	private void Start ()
    {
        m_Dropdown = GetComponent<Dropdown>();
        m_Dropdown.options.Clear();
        m_Dropdown.captionText.text = string.Empty;
        m_Dropdown.value = -1;
    }
Ejemplo n.º 11
0
 void Start()
 {
     Debug.Log("---- PLAYER_TYPE_DROPDOWN.Start()");
     self = GetComponent<Dropdown>();
     scriptselect.gameObject.SetActive(false);
     Debug.Log("---- END PLAYER_TYPE_DROPDOWN.Start()");
 }
Ejemplo n.º 12
0
	void Start() {
		VRSettings.enabled = false;

		InputField inF = FindObjectOfType(typeof(InputField)) as InputField;
		Dropdown[] dds = FindObjectsOfType(typeof(Dropdown))  as Dropdown[];
		Slider     CAD = FindObjectOfType(typeof(Slider))     as Slider;

		if (inF != null) {
			nameField = inF;
		}

		if (dds != null) {
			for (int i = 0; i < dds.Length; i++) {
				Dropdown dd = dds[i];
				if (dd.name == "Trial Type") {
					trialType = dd;
				}
				else if (dd.name == "Handedness") {
					handedness = dd;
				}
			}
		}

		if (CAD != null) {
			CADExperience = CAD;
		}
	} 
Ejemplo n.º 13
0
    private Ingredient ConvertDropdownValueToIngredient(Dropdown dropdown, List<Ingredient> ingredientList)
    {
        var result = ingredientList.FirstOrDefault(i => i.Name == dropdown.options[dropdown.value].text);
        if (result == null)
            throw new Exception("Ingredient list did not contain selected option. Wrong combo of dropdown and ingredient list?");

        return result;
    }
 void OnOptionChange(Dropdown d) {
     if (d.value == 0) { 
         Localisation.Instance.LoadLanguage(Localisation.Language.English);
     } else {
         Localisation.Instance.LoadLanguage(Localisation.Language.Russian);
     }
     GetComponentInParent<SettingsTranslation>().UpdateText();
 }
Ejemplo n.º 15
0
    void Start()
    {
        dp = GetComponent<Dropdown> ();
        dp.onValueChanged.AddListener(onChange);

        planets = new Rigidbody[] {Sun, Mercury, Venus, Earth, Mars, Jupiter, Saturn, Neptune, Uranus};
        CurrentPlanet = PlanetToStartWith;
    }
Ejemplo n.º 16
0
    private void FillDropdown(Dropdown partDrop) {
        partDrop.options.Clear();

        foreach (BodyPart bp in Settings.Instance.GetAllowedBodyParts(partDrop == BodypartSelectors[0])) {
            partDrop.options.Add(new Dropdown.OptionData() { text = bp.Name });
        }
        
    }
Ejemplo n.º 17
0
 public void OnCommandChanged(int command)
 {
     Selected = null;
     if ((int)_codeLine.Cmd == command)
         return;
     _codeLine.Cmd = (CodeLine.Instruction) command;
     Setup(_codeLine, _number);
 }
Ejemplo n.º 18
0
 void Start()
 {
     dropDown = GetComponent<Dropdown>();
     cam_switcher = CameraSettingsManager.GetComponent<CameraSwitch>();
     cam_switcher.Init();
     dropDown.value = PlayerPrefs.GetInt(CameraSettings.Instance.CAMERA_TYPE);
     SetCameraType();
 }
Ejemplo n.º 19
0
 void onDropdownChanged(Dropdown dropdown)
 {
     if (team == 0)
         BoardManager.AIBlue = OptionsToAI[dropdown.value];
     else
         BoardManager.AIRed = OptionsToAI[dropdown.value];
     Debug.Log("AI selected: " + OptionsToAI[dropdown.value]);
 }
Ejemplo n.º 20
0
//===========================================================
// 関数定義
//===========================================================
	//---------------------------------------------------
	// コンストラクタ
	//---------------------------------------------------
	void Awake()
	{
		m_CellList	= new List<CZParamCell>();
		m_ColName	= transform.FindChild("InputName").FindChild("Text").GetComponent<Text>();
		m_SelType	= transform.FindChild("SelType").GetComponent<Dropdown>();

		m_vColSize	= m_ColName.GetComponent<RectTransform>().sizeDelta;
	}
Ejemplo n.º 21
0
 public void OnCustomOptionSelected(Dropdown dropdown)
 {
     if (dropdown.value == 3) {
         TurnOnCanvasGroup();
     }
     else {
         TurnOffCanvasGroup();
     }
 }
    // Use this for initialization
    void Start()
    {
        dropdown = GetComponent<Dropdown>();

        foreach (var v in Enum.GetNames(typeof (Objectives.Type)))
        {
            dropdown.options.Add(new Dropdown.OptionData(v));
        }
    }
Ejemplo n.º 23
0
    // Use this for initialization
    void Start()
    {
        //image = GetComponent<Image>();
        dropdown = GetComponent<Dropdown>();
        dropdown.onValueChanged.AddListener(DropdownValueChange);

        houses = new GameObject();
        houses.transform.name = "Houses";
    }
Ejemplo n.º 24
0
    //public Sprite imgDisabledState;

    // Use this for initialization
    void Start()
    {
        dropdown = GameObject.Find(object_name).GetComponent<Dropdown>();
        dropdown.AddOptions(new List<string> { "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", " " });
        dropdown.onValueChanged.AddListener(ChangeValue);
        manager = GameObject.Find("Manager").GetComponent<Manager>();
        //DisableSelectedNumbers();
        manager.ValueChangedEvent += ResetSelectedNumbers;
    }
Ejemplo n.º 25
0
		protected override void Init()
		{
			uiDropdown = GetComponent<Dropdown>();
			uiDropdown.onValueChanged.AddListener(OnChangeId);
			AddUpdater(enabledName, UpdateEnabled);
			AddUpdater(interactableName, UpdateInteractable);
			AddUpdater(selectNumName, UpdateSelectNumber);
			AddUpdater(captionListName, UpdateCaptionList);
		}
Ejemplo n.º 26
0
    public void ChangeScene(Dropdown _dropdown)
    {
        for (int i = 0; i < maps.transform.childCount; i++)
        {
            maps.transform.GetChild(i).gameObject.SetActive(false);
        }

        maps.transform.GetChild(_dropdown.value).gameObject.SetActive(true);
        selectedMap = maps.transform.GetChild(_dropdown.value).GetComponent<Map>();
    }
Ejemplo n.º 27
0
	void Start() {
		VRSettings.enabled = false;

		Dropdown dd = FindObjectOfType(typeof(Dropdown)) as Dropdown;
		if (dd != null) {
			userList = dd;
		}

		PopulateUserList();
	}
Ejemplo n.º 28
0
    public void PartDropChanged(Dropdown partDrop) {
        if (partDrop == BodypartSelectors[0]) {
            Settings.Instance.BodyPartTreated = Settings.Instance.GetBodypartByName(partDrop.captionText.text);
            FillDropdown(BodypartSelectors[1]);
        } else {
            Settings.Instance.BodyPartHealthy = Settings.Instance.GetBodypartByName(partDrop.captionText.text);
            FillDropdown(BodypartSelectors[0]);
        }

        Settings.Instance.SaveSettings();
    }
Ejemplo n.º 29
0
 //change to/from fullscreen
 public void changeFullscreen(Dropdown dropdown)
 {
     if (dropdown.value == 0)//fullscreen
     {
         Screen.SetResolution(maxGameWidth, maxGameHeight, true);
     }
     else if (dropdown.value == 1)//not fullscreen
     {
         Screen.SetResolution(gVar.gameWidth, gVar.gameHeight, false);
     }
 }
    // Use this for initialization
    void Start ()
    {
        m_Dropdown = GetComponent<Dropdown>();
        Resolution[] resolutions = Screen.resolutions;

        foreach (Resolution resolution in resolutions)
        {
            m_Dropdown.options.Add(new Dropdown.OptionData(ResToString(resolution)));
        }

        m_Dropdown.onValueChanged.AddListener(delegate { Screen.SetResolution(resolutions[m_Dropdown.value].width, resolutions[m_Dropdown.value].height, true); });
    }
Ejemplo n.º 31
0
        public UINode DrawLayer(Layer layer, UINode parent)
        {
            UINode        node      = PSDImportUtility.InstantiateItem(PSDImporterConst.PREFAB_PATH_DROPDOWN, layer.name, parent);
            Dropdown      dropdown  = node.GetComponent <Dropdown>();
            ScrollRect    scrllRect = dropdown.template.GetComponent <ScrollRect>();
            RectTransform content   = scrllRect.content;
            Toggle        toggle    = content.GetComponentInChildren <Toggle>();

            UINode childNode = new UINode(dropdown.template, node);

            childNode.transform.SetParent(PSDImportUtility.canvas.transform);
            childNode.anchoType = UINode.AnchoType.Down | UINode.AnchoType.XStretch;
            //由于设置相对坐标需要,所以修改了部分预制体的状态
            childNode.ReprocessEvent = () => {
                RectTransform rt = childNode.GetComponent <RectTransform>();
                rt.pivot            = new Vector2(0.5f, 1);
                rt.anchoredPosition = Vector3.zero;
            };
            for (int i = 0; i < layer.images.Length; i++)
            {
                Image  image     = layer.images[i];
                string lowerName = image.name.ToLower();
                if (lowerName.StartsWith("b1_"))
                {
                    PSDImportUtility.SetPictureOrLoadColor(image, dropdown.image);
                    PSDImportUtility.SetRectTransform(image, dropdown.GetComponent <RectTransform>());
                    dropdown.name = layer.name;
                }
                else if (lowerName.StartsWith("b2_"))
                {
                    PSDImportUtility.SetPictureOrLoadColor(image, dropdown.template.GetComponent <Graphic>());
                    PSDImportUtility.SetRectTransform(image, dropdown.template);
                }
                else if (lowerName.StartsWith("b3_"))
                {
                    UnityEngine.UI.Image itemimage = (UnityEngine.UI.Image)toggle.targetGraphic;
                    PSDImportUtility.SetPictureOrLoadColor(image, itemimage);
                    content.SetSizeWithCurrentAnchors(RectTransform.Axis.Vertical, image.size.height);
                }
                else if (lowerName.StartsWith("l1_"))
                {
                    PSDImportUtility.SetPictureOrLoadColor(image, dropdown.captionText);
                    float size;
                    if (float.TryParse(image.arguments[2], out size))
                    {
                        dropdown.captionText.fontSize = (int)size;
                    }
                    dropdown.captionText.text = image.arguments[3];
                }
                else if (lowerName.StartsWith("l2_"))
                {
                    PSDImportUtility.SetPictureOrLoadColor(image, dropdown.itemText);
                    float size;
                    if (float.TryParse(image.arguments[2], out size))
                    {
                        dropdown.itemText.fontSize = (int)size;
                    }
                    dropdown.itemText.text = image.arguments[3];
                }
                else if (lowerName.StartsWith("m_"))
                {
                    UnityEngine.UI.Image mask = (UnityEngine.UI.Image)toggle.graphic;
                    PSDImportUtility.SetPictureOrLoadColor(image, mask);
                }
                else
                {
                    ctrl.DrawImage(image, node);
                }
            }

            for (int i = 0; i < layer.layers.Length; i++)
            {
                Layer  child     = layer.layers[i];
                string lowerName = child.name;
                if (lowerName.StartsWith("vb_"))
                {
                    UINode barNode = ctrl.DrawLayer(child, childNode);
                    scrllRect.verticalScrollbar           = barNode.GetComponent <Scrollbar>();
                    scrllRect.verticalScrollbarVisibility = ScrollRect.ScrollbarVisibility.AutoHide;
                }
                else
                {
                    ctrl.DrawLayer(child, node);
                }
            }

            return(node);
        }
 void valueChanged_customProfiles(Dropdown sender)
 {
     ConfigManager.GetInstance().SelectProfile_customize(sender.value);
 }
Ejemplo n.º 33
0
 /// <summary>
 /// Set the selection to target index.
 /// </summary>
 /// <param name="dd"> dropdown object. </param>
 /// <param name="selection"> selection id. </param>
 public static void Dropdown_SetSelection(Dropdown dd, int selection)
 {
     dd.value = selection;
 }
Ejemplo n.º 34
0
 public void OnVideoQualityValueChanged(Dropdown dp)
 {
     SetVideoQuality((VideoQuality)dp.value);
 }
Ejemplo n.º 35
0
        /// <summary>
        /// Replacing entering DropDown optionsList to your sprite list
        /// </summary>
        /// <param name="dropdown">DropDown to replace</param>
        /// <param name="colors">Colors list to replace</param>
        /// <param name="enter">DropDown with starting parameters</param>
        public static void FillDropDownByColorAndTextList(out Dropdown dropdown, List <Color> colors, List <string> strings, Dropdown enter)
        {
            dropdown = enter;
            if (colors.Count != strings.Count)
            {
                return;
            }

            List <Dropdown.OptionData> options = new List <Dropdown.OptionData>();

            for (int i = 0; i < colors.Count; i++)
            {
                Texture2D imgcol = new Texture2D(1, 1, TextureFormat.RGBA32, false);
                imgcol.SetPixel(1, 1, colors[i]);
                imgcol.Apply();
                options.Add(new Dropdown.OptionData());
                options[i].image = Sprite.Create(imgcol, new Rect(0.0f, 0.0f, imgcol.width, imgcol.height), new Vector2(0.5f, 0.5f));
                options[i].text  = strings[i];
            }
            dropdown.options = options;
        }
Ejemplo n.º 36
0
 public static Dropdown <THelper> SetDropup <THelper>(this Dropdown <THelper> dropdown, bool dropup = true)
     where THelper : BootstrapHelper <THelper>
 {
     dropdown.ToggleCss(Css.Dropup, dropup);
     return(dropdown);
 }
Ejemplo n.º 37
0
 public static Dropdown <THelper> SetCaret <THelper>(this Dropdown <THelper> dropdown, bool caret = true)
     where THelper : BootstrapHelper <THelper>
 {
     dropdown.Caret = caret;
     return(dropdown);
 }
Ejemplo n.º 38
0
 // Use this for initialization
 void Start()
 {
     selector = GetComponent <Dropdown> ();
 }
Ejemplo n.º 39
0
 void Start()
 {
     dropdown = gameObject.GetComponent <Dropdown>();
     UpdateValue();
 }
Ejemplo n.º 40
0
    void Start()
    {
        skeletonMaterial = Resources.Load("Skeleton", typeof(Material)) as Material;

        barracudaRunner = GameObject.Find("BarracudaRunner").GetComponent <VNectBarracudaRunner>();
        barracudaRunner.ModelQuality = configurationSetting.TrainedModel;

        videoCapture = GameObject.Find("MainTexrure").GetComponent <VideoCapture>();

        Menu        = GameObject.Find("Menu");
        cameraMover = GameObject.Find("MainCamera").GetComponent <CameraMover>();

        sourceDevice = GameObject.Find("SourceDevice").GetComponent <Dropdown>();
        WebCamDevice[] devices = WebCamTexture.devices;
        foreach (var d in devices)
        {
            sourceDevice.options.Add(new Dropdown.OptionData(d.name));
        }
        sourceDevice.value = 0;

        btnPause     = GameObject.Find("btnPause").GetComponent <Button>();
        ifFrame      = GameObject.Find("ifFrame").GetComponent <InputField>();
        txFrameCount = GameObject.Find("txFrameCount").GetComponent <Text>();
        btnSkip      = GameObject.Find("btnSkip").GetComponent <Button>();
        pnlVideoIF   = GameObject.Find("pnlVideoIF");
        pnlVideoIF.SetActive(false);

        btnSourceDevice = GameObject.Find("btnSourceDevice").GetComponent <Button>();
        txtFPS          = GameObject.Find("txtFPS").GetComponent <Text>();
        btnRecord       = GameObject.Find("btnRecord").GetComponent <Button>();

        avatars = GameObject.Find("Avatars").GetComponent <Dropdown>();

        avatarSetting = GameObject.Find("AvatarSetting").GetComponent <AvatarSettingScript>();
        avatarSetting.Init();
        avatarSetting.gameObject.SetActive(false);
        configuration = GameObject.Find("Configuration").GetComponent <ConfigurationScript>();
        configuration.Init();
        configuration.gameObject.SetActive(false);

        ReflectConfiguration(configurationSetting);

        var settings = PlayerPrefs.GetString("AvatarSettings", "");

        //settings = "";
        // Decode Avatar Setting
        string[] asStr = settings.Split(';');
        foreach (var s in asStr)
        {
            string[] col = s.Split(',');
            if (col.Length != 16)
            {
                continue;
            }
            var setting = new AvatarSetting();

            if (!int.TryParse(col[0], out setting.AvatarType))
            {
                continue;
            }
            if (setting.AvatarType < 0)
            {
            }
            else if (setting.AvatarType == 0)
            {
                setting.VRMFilePath = col[1];
            }
            else if (setting.AvatarType == 1)
            {
                setting.FBXFilePath = col[1];
            }
            setting.AvatarName = col[2];
            if (!float.TryParse(col[3], out setting.PosX))
            {
                continue;
            }
            if (!float.TryParse(col[4], out setting.PosY))
            {
                continue;
            }
            if (!float.TryParse(col[5], out setting.PosZ))
            {
                continue;
            }
            if (!float.TryParse(col[6], out setting.DepthScale))
            {
                continue;
            }
            if (!float.TryParse(col[7], out setting.Scale))
            {
                continue;
            }
            if (!float.TryParse(col[8], out setting.FaceOriX))
            {
                continue;
            }
            if (!float.TryParse(col[9], out setting.FaceOriY))
            {
                continue;
            }
            if (!float.TryParse(col[10], out setting.FaceOriZ))
            {
                continue;
            }
            if (!int.TryParse(col[11], out setting.SkeletonVisible))
            {
                continue;
            }
            if (!float.TryParse(col[12], out setting.SkeletonPosX))
            {
                continue;
            }
            if (!float.TryParse(col[13], out setting.SkeletonPosY))
            {
                continue;
            }
            if (!float.TryParse(col[14], out setting.SkeletonPosZ))
            {
                continue;
            }
            if (!float.TryParse(col[15], out setting.SkeletonScale))
            {
                continue;
            }

            AvatarList.Add(setting);
        }
        ;

        if (AvatarList.Count == 0)
        {
            var setting = new AvatarSetting()
            {
                AvatarType = -1,
                AvatarName = "蘭鈴りゅん (Lune)",
                Avatar     = GameObject.Find("Lune").GetComponent <VNectModel>(),
            };
            setting.Avatar.SetNose(setting.FaceOriX, setting.FaceOriY, setting.FaceOriZ);
            AvatarList.Add(setting);
            barracudaRunner.InitVNectModel(setting.Avatar, configurationSetting);

            setting = new AvatarSetting()
            {
                AvatarType = -2,
                AvatarName = "yukihiko-chan",
                Avatar     = GameObject.Find("YukihikoAoyagi").GetComponent <VNectModel>(),
            };
            setting.Avatar.SetNose(setting.FaceOriX, setting.FaceOriY, setting.FaceOriZ);
            AvatarList.Add(setting);
            barracudaRunner.InitVNectModel(setting.Avatar, configurationSetting);
        }

        avatars.options.Clear();
        foreach (var setting in AvatarList)
        {
            if (setting.AvatarType >= 0)
            {
                LoadAvatar(setting);
            }
            else if (setting.AvatarType < 0)
            {
                avatars.options.Add(new Dropdown.OptionData(setting.AvatarName));

                switch (setting.AvatarType)
                {
                case -1:
                    setting.Avatar = GameObject.Find("Lune").GetComponent <VNectModel>();
                    break;

                case -2:
                    setting.Avatar = GameObject.Find("YukihikoAoyagi").GetComponent <VNectModel>();
                    break;
                }

                setting.Avatar.SetNose(setting.FaceOriX, setting.FaceOriY, setting.FaceOriZ);
                barracudaRunner.InitVNectModel(setting.Avatar, configurationSetting);
            }
        }
        avatars.value = 0;
        ChangedAvatar(0);
    }
Ejemplo n.º 41
0
 private void Start()
 {
     enemy       = transform.GetComponentInChildren <Dropdown>();
     input       = transform.GetComponentInChildren <InputField>();
     waveSpawner = GameMaster.transform.GetComponent <WaveSpawner>();
 }
Ejemplo n.º 42
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.

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

            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.

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

            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);
        }
Ejemplo n.º 43
0
        public void Initialize(MethodInfo info, SelectionBlock selected)
        {
            nameText.text = info.Name;
            SelectedBlock = selected;

            /* Iterate through parameters here and construct a new block
             * from the given parameter prefabs (e.g. FloatFieldPrefab, BoolFieldPrefab etc.)
             * Add new parameters in this loop
             * It's necessary to add a listener that will change the block's parameters
             */
            ParameterInfo[] infos = info.GetParameters();
            Parameters = (infos.Length > 0) ? new object[infos.Length] : null;
            for (int i = 0; i < infos.Length; i++)
            {
                Type parameterType = infos[i].ParameterType;
                int  index         = i;

                if (parameterType == typeof(int))
                {
                    InputField inputField = InstantiateBlockParameter <InputField>(IntFieldPrefab); // Instantiate the parameter UI
                    Parameters[index] = Int32.Parse(inputField.text);                               // Get the initial value

                    // Add a listener that changes the parameter property when edited
                    inputField.onEndEdit.AddListener(delegate
                    {
                        if (inputField.text == "")
                        {
                            inputField.text = "0";
                        }

                        Parameters[index] = Int32.Parse(inputField.text);
                    });
                }
                else if (parameterType.BaseType == typeof(Enum))
                {
                    Dropdown dropdown = InstantiateBlockParameter <Dropdown>(DropdownPrefab);

                    // Populate the dropdown list
                    foreach (var option in Enum.GetValues(infos[i].ParameterType))
                    {
                        dropdown.options.Add(new Dropdown.OptionData(option.ToString()));
                    }

                    Parameters[index] = dropdown.value;
                    dropdown.onValueChanged.AddListener(delegate { Parameters[index] = dropdown.value; });
                }
                else if (parameterType == typeof(float))
                {
                    InputField inputField = InstantiateBlockParameter <InputField>(FloatFieldPrefab);
                    Parameters[index] = float.Parse(inputField.text);
                    inputField.onEndEdit.AddListener(delegate
                    {
                        if (inputField.text == "")
                        {
                            inputField.text = "0";
                        }

                        Parameters[index] = float.Parse(inputField.text);
                    });
                }
                else if (parameterType == typeof(string))
                {
                    InputField inputField = InstantiateBlockParameter <InputField>(StringFieldPrefab);
                    Parameters[index] = inputField.text;
                    inputField.onEndEdit.AddListener(x => Parameters[index] = inputField.text);
                }
                else if (parameterType == typeof(bool))
                {
                    Toggle toggle = InstantiateBlockParameter <Toggle>(BoolFieldPrefab);
                    Parameters[index] = toggle.isOn;
                    toggle.onValueChanged.AddListener(x => Parameters[index] = toggle.isOn);
                }
            }

            Canvas.ForceUpdateCanvases();
            FitToChildren();
        }
Ejemplo n.º 44
0
 void Start()
 {
     dropdown = GameObject.Find("Dropdown").GetComponent <Dropdown>();
     PopulateList();
 }
Ejemplo n.º 45
0
    private void DrawRightHand(ParameterType type)
    {
        Destroy(_rightHand);
        Destroy(_comparator);
        _comparator = Instantiate(_timeLine.EntryHudScriptableObject.CastLabel, transform).GetComponent <Dropdown>();
        _rightHand  = Instantiate(_timeLine.EntryHudScriptableObject.CastLabel, transform).GetComponent <Dropdown>();

        var rhOptions = from val in _mainTimeLine.CustomRefrenceValues where val.Type.Equality(type) select val;

        _rightHand.ClearOptions();
        List <string> rhOptionsAsString = AsStringList(rhOptions);

        _rightHand.AddOptions(rhOptionsAsString);
        if (_entry.Parameters.TryGetValue(_righthandString, out ParameterData parameterDataRh))
        {
            _rightHand.SetValueWithoutNotify(rhOptionsAsString.IndexOf(parameterDataRh.RefrenceValue.Label));
        }
        else if (rhOptions.Count() != 0)
        {
            _rightHand.SetValueWithoutNotify(0);

            _entry.Parameters[_righthandString] = new ParameterData()
            {
                IsRefrenceValue = true,
                RefrenceValue   = rhOptions.First()
            };
        }
        _rightHand.onValueChanged.AddListener(r =>
        {
            if (rhOptions.Count() == 0)
            {
                return;
            }
            var rhOption = rhOptions.ElementAt(r);
            StoreParameter(rhOption, _righthandString,
                           new ParameterData()
            {
                IsRefrenceValue = true,
                RefrenceValue   = rhOption,
                Value           = null
            });
        });

        var comparatorOptions = new List <string>()
        {
            "=="
        };

        if (type == ParameterType.NUM)
        {
            comparatorOptions.Add("<");
            comparatorOptions.Add(">");
        }
        _comparator.ClearOptions();
        _comparator.AddOptions(comparatorOptions);

        if (_entry.Parameters.TryGetValue(_comparatorString, out ParameterData parameterDataComp))
        {
            _comparator.SetValueWithoutNotify(comparatorOptions.IndexOf(parameterDataComp.Value.ToString()));
        }
        else
        {
            _entry.Parameters[_comparatorString] = new ParameterData {
                Value = comparatorOptions[0]
            };
            _comparator.SetValueWithoutNotify(0);
        }

        _comparator.onValueChanged.AddListener(c =>
        {
            _entry.Parameters[_comparatorString] = new ParameterData()
            {
                Value = comparatorOptions[c]
            };
        });

        AlignParameterWidnows(new List <GameObject> {
            _leftHand.gameObject,
            _comparator.gameObject,
            _rightHand.gameObject
        });
    }
Ejemplo n.º 46
0
        public override void Connect()
        {
            dropdown = GetComponent <Dropdown>();

            var selectionPropertyEndPoint = MakeViewModelEndPoint(viewModelSelectionPropertyName, selectionUIToViewModelAdapter, null);

            var selectionPropertySync = new PropertySync(
                // Source
                selectionPropertyEndPoint,

                // Dest
                new PropertyEndPoint(
                    this,
                    "SelectedOption",
                    CreateAdapter(selectionViewModelToUIAdapter),
                    null,
                    "view",
                    this
                    ),

                // Errors, exceptions and validation.
                !string.IsNullOrEmpty(exceptionPropertyName)
                    ? MakeViewModelEndPoint(exceptionPropertyName, exceptionAdapterTypeName, null)
                    : null
                ,

                this
                );

            selectionPropertyWatcher = selectionPropertyEndPoint
                                       .Watch(() => selectionPropertySync.SyncFromSource());

            selectionEventWatcher = new UnityEventWatcher(
                dropdown,
                "onValueChanged",
                () =>
            {
                selectedOption = Options[dropdown.value];     // Copy value back from dropdown.
                selectionPropertySync.SyncFromDest();
            }
                );

            var optionsPropertySync = new PropertySync(
                // Source
                MakeViewModelEndPoint(viewModelOptionsPropertyName, null, null),

                // Dest
                new PropertyEndPoint(
                    this,
                    "Options",
                    CreateAdapter(optionsAdapter),
                    null,
                    "view",
                    this
                    ),

                // Errors, exceptions and validation.
                null, // Validation not needed

                this
                );

            // Copy the initial value from view-model to view.
            optionsPropertySync.SyncFromSource();
            selectionPropertySync.SyncFromSource();
            UpdateOptions();
        }
Ejemplo n.º 47
0
 public void OnQualityDropdownValueChanged(Dropdown dropdown)
 {
     QualitySettings.SetQualityLevel(dropdown.value);
 }
Ejemplo n.º 48
0
 void RobotDropdownValueChanged(Dropdown dp)
 {
     settings_IpConfigManager.NewRobotSelected(rosConnectors[dp.value]);
     settings_RosModeManager.NewRobotSelected(rosConnectors[dp.value]);
     robotControl_PoseSelectionManager.NewRobotSelected(rosConnectors[dp.value]);
 }
Ejemplo n.º 49
0
 public static Dropdown <THelper> SetMenuLeft <THelper>(this Dropdown <THelper> dropdown, bool menuLeft = true)
     where THelper : BootstrapHelper <THelper>
 {
     dropdown.MenuLeft = menuLeft;
     return(dropdown);
 }
Ejemplo n.º 50
0
        /// <summary>
        /// Replacing entering DropDown optionsList to your sprite list
        /// </summary>
        /// <param name="dropdown">DropDown to replace</param>
        /// <param name="sprites">Sprite list to replace</param>
        /// <param name="enter">DropDown with starting parameters</param>
        public static void FillDropDownBySpriteList(out Dropdown dropdown, List <Sprite> sprites, Dropdown enter)
        {
            dropdown = enter;
            List <Dropdown.OptionData> options = new List <Dropdown.OptionData>();

            for (int i = 0; i < sprites.Count; i++)
            {
                options.Add(new Dropdown.OptionData());
                options[i].image = sprites[i];
            }
            dropdown.options = options;
        }
Ejemplo n.º 51
0
 private void Awake()
 {
     dropdown = gameObject.GetComponentInChildren <Dropdown>();
 }
Ejemplo n.º 52
0
 /// <summary>
 /// Returns item vlaue by index.
 /// </summary>
 /// <param name="dd"> Dropdown object. </param>
 /// <param name="index"> item name. </param>
 /// <returns> Current selected text value. </returns>
 public static string Dropdown_GetItemValue(Dropdown dd, int index)
 {
     return(dd.options[index].text);
 }
Ejemplo n.º 53
0
 protected override void Reset()
 {
     base.Reset();
     this.dropdown = GetComponentInChildren <Dropdown>();
 }
Ejemplo n.º 54
0
    public void SaveSettingsButton()
    {
        Dropdown forward  = GameObject.FindGameObjectWithTag("Forward").GetComponent <Dropdown>();
        Dropdown backward = GameObject.FindGameObjectWithTag("Backward").GetComponent <Dropdown>();
        Dropdown left     = GameObject.FindGameObjectWithTag("Left").GetComponent <Dropdown>();
        Dropdown right    = GameObject.FindGameObjectWithTag("Right").GetComponent <Dropdown>();
        Dropdown shoot    = GameObject.FindGameObjectWithTag("Shoot").GetComponent <Dropdown>();
        Dropdown use      = GameObject.FindGameObjectWithTag("Use").GetComponent <Dropdown> ();
        Dropdown menu     = GameObject.FindGameObjectWithTag("Menu").GetComponent <Dropdown>();


        int forwardKey  = forward.value;
        int backwardKey = backward.value;
        int leftKey     = left.value;
        int rightKey    = right.value;
        int shootKey    = shoot.value;
        int useKey      = use.value;
        int menuKey     = menu.value;


        if (forwardKey == 0)
        {
            PlayerPrefs.SetString("control_forward", "w");
        }
        else if (forwardKey == 1)
        {
            PlayerPrefs.SetString("control_forward", "up");
        }

        if (backwardKey == 0)
        {
            PlayerPrefs.SetString("control_backward", "s");
        }
        else if (backwardKey == 1)
        {
            PlayerPrefs.SetString("control_backward", "down");
        }

        if (leftKey == 0)
        {
            PlayerPrefs.SetString("control_left", "a");
        }
        else if (leftKey == 1)
        {
            PlayerPrefs.SetString("control_left", "left");
        }

        if (rightKey == 0)
        {
            PlayerPrefs.SetString("control_right", "d");
        }
        else if (rightKey == 1)
        {
            PlayerPrefs.SetString("control_right", "right");
        }

        if (shootKey == 0)
        {
            PlayerPrefs.SetString("control_shoot", "mouse0");
        }
        else if (shootKey == 1)
        {
            PlayerPrefs.SetString("control_shoot", "space");
        }

        if (useKey == 0)
        {
            PlayerPrefs.SetString("control_use", "e");
        }
        else if (useKey == 1)
        {
            PlayerPrefs.SetString("control_use", "f");
        }

        if (menuKey == 0)
        {
            PlayerPrefs.SetString("control_menu", "escape");
        }
        else if (menuKey == 1)
        {
            PlayerPrefs.SetString("control_menu", "p");
        }
    }
Ejemplo n.º 55
0
        /// <summary>
        /// Replacing entering DropDown optionsList to your text list
        /// </summary>
        /// <param name="dropdown">DropDown to replace</param>
        /// <param name="strings">String list to replace</param>
        /// <param name="enter">DropDown with starting parameters</param>
        public static void FillDropDownByTextList(out Dropdown dropdown, List <string> strings, Dropdown enter)
        {
            dropdown = enter;
            List <Dropdown.OptionData> options = new List <Dropdown.OptionData>();

            for (int i = 0; i < strings.Count; i++)
            {
                options.Add(new Dropdown.OptionData());
                options[i].text = strings[i];
            }
            dropdown.options = options;
        }
Ejemplo n.º 56
0
 public ActionResult Create()
 {
     ViewBag.GetCountryList = Dropdown.GetCountryList();
     return(View());
 }
Ejemplo n.º 57
0
        /// <summary>
        /// Replacing entering DropDown optionsList to your sprite and string list (index to index)
        /// </summary>
        /// <param name="dropdown">DropDown to replace</param>
        /// <param name="sprites">Sprite list to replace</param>
        /// <param name="strings">String list to replace</param>
        /// <param name="enter">DropDown with starting parameters</param>
        public static void FillDropDownBySpriteAndTextList(out Dropdown dropdown, List <Sprite> sprites, List <string> strings, Dropdown enter)
        {
            dropdown = enter;
            if (sprites.Count != strings.Count)
            {
                return;
            }

            List <Dropdown.OptionData> options = new List <Dropdown.OptionData>();

            for (int i = 0; i < sprites.Count; i++)
            {
                options.Add(new Dropdown.OptionData());
                options[i].image = sprites[i];
                options[i].text  = strings[i];
            }
            dropdown.options = options;
        }
Ejemplo n.º 58
0
 void Awake()
 {
     dropdown = GetComponent <Dropdown>();
     dropdown.onValueChanged.AddListener(OnDropdownClick);
 }
Ejemplo n.º 59
0
 public void OnResolutionValueChanged(Dropdown dp)
 {
     SetResolution((VideoResolution)dp.value);
 }
Ejemplo n.º 60
0
 /// <summary>
 /// Get the current selected value of the Dropdown object.
 /// </summary>
 /// <param name="dd"> drop down object. </param>
 /// <returns> Current selected text value. </returns>
 public static string Dropdown_GetSelectedValue(Dropdown dd)
 {
     return(Dropdown_GetItemValue(dd, dd.value));
 }