void assignList() { List <TMP_Dropdown.OptionData> substatList = sub1.GetComponent <TMP_Dropdown>().options; // puts it into a list /* List<TMP_Dropdown.OptionData> substat2List = sub2.GetComponent<TMP_Dropdown>().options; * List<TMP_Dropdown.OptionData> substat3List = sub3.GetComponent<TMP_Dropdown>().options; * List<TMP_Dropdown.OptionData> substat4List = sub4.GetComponent<TMP_Dropdown>().options; */ }
void Start() { heroGoldRewardInput.onValueChanged.AddListener((value) => { if (string.IsNullOrEmpty(value)) { value = "0"; } int goldValue = int.Parse(value); QuestDetailsWindow.Instance.SelectedGoldRewards[m_HeroNumber] = goldValue; CheckPostButtonStatus(); }); heroGoldRewardInput.onDeselect.AddListener((value) => { if (string.IsNullOrEmpty(value)) { heroGoldRewardInput.text = "0"; } }); heroRewardItemDropdown.onValueChanged.AddListener((value) => { m_SelectedItemReward = value; GameItem item = null; if (m_SelectedItemReward != 0) { item = InventoryManager.OwnedItems[m_SelectedItemReward - 1]; } heroRewardItemDropdown.GetComponent <GameItemPopupCaller>().associatedItem = item; QuestDetailsWindow.Instance.SelectedItemRewards[m_HeroNumber] = item; CheckPostButtonStatus(); }); heroSelectButton.onClick.AddListener(() => { AvailableHeroes.Clear(); foreach (HeroInstance hero in HeroManager.GetAvailableHeroes()) { if (CurrentQuest.WouldHeroAccept(hero, m_HeroNumber) && !QuestDetailsWindow.Instance.HasHeroSelected(hero)) { AvailableHeroes.Add(hero); } } RightSideSwitch.Instance.ActivateObject(ReputationUI.Instance.gameObject, false); ReputationUI.Instance.SetAvailableHeroes(AvailableHeroes, SetSelectedHero); }); }
// Start is called before the first frame update void Start() { typeChangeDrop.GetComponent <TMP_Dropdown>(); attChangeDrop.GetComponent <TMP_Dropdown>(); typeBtn.GetComponent <Button>(); attBtn.GetComponent <Button>(); List <string> types = new List <string>(); List <string> atts = new List <string>(); foreach (KeyValuePair <string, string> tileTypes in GetComponentInParent <MapEditor>().TileValues) { types.Add(tileTypes.Value); } foreach (KeyValuePair <string, string> attTypes in GetComponentInParent <MapEditor>().TileAttributes) { atts.Add(attTypes.Value); } typeChangeDrop.AddOptions(types); attChangeDrop.AddOptions(atts); //typeChangeDrop.value = 0; //attChangeDrop.value = 0; }
void Start() { m_MainCamera = Camera.main.gameObject; m_DistanceLeft.gameObject.SetActive(false); m_TimeLeft.gameObject.SetActive(false); navigationPrefab = m_DistanceLeft.transform.parent.gameObject; navigationPrefab.SetActive(false); leftArrow = m_Direction.transform.GetChild(0).gameObject; rightArrow = m_Direction.transform.GetChild(1).gameObject; m_LeftDirectionArrow.SetActive(false); m_RightDirectionArrow.SetActive(false); dropdown = dropdown.GetComponent <TMP_Dropdown>(); if (m_navigationPathPrefab != null) { if (m_navigationPathObject == null) { m_navigationPathObject = Instantiate(m_navigationPathPrefab); m_navigationPathObject.SetActive(false); m_navigationPath = m_navigationPathObject.GetComponent <NavigationPath>(); } if (m_navigationPath == null) { Debug.LogWarning("NavigationManager: NavigationPath component in Navigation path is missing."); return; } } }
public void UpdateSelectablesMenu(string position, ObjectsLoader.RoomObject[] optionsIn, Action <int> callback) { //Initialise the Text to say the value of position //selectablesText.text = position; selectableObjects = optionsIn; SelectablesDropOptions.Clear(); foreach (ObjectsLoader.RoomObject s in optionsIn) { Debug.Log(s.type); SelectablesDropOptions.Add(s.type); } //Fetch the Dropdown GameObject the script is attached to selectablesDropdown = GetComponent <TMP_Dropdown>(); //Clear the old options of the Dropdown menu selectablesDropdown.ClearOptions(); //Add the options created in the List above selectablesDropdown.AddOptions(SelectablesDropOptions); // makes fake option selectablesDropdown.options.Add(new TMP_Dropdown.OptionData() { text = "" }); // selects fake option selectablesDropdown.value = selectablesDropdown.GetComponent <TMP_Dropdown>().options.Count - 1; // removes fake option selectablesDropdown.options.RemoveAt(selectablesDropdown.options.Count - 1); //Add listener for when the value of the Dropdown changes, to take action selectablesDropdown.onValueChanged.AddListener(delegate { DropdownValueChanged(selectablesDropdown, callback); }); selectablesDropdown.Show(); }
public RegistrationRequest GetRegistrationInfo() { DateTime birth_date = GetBirthDate(); RegistrationRequest res = new RegistrationRequest(GenderDropdown.GetComponent <TMP_Dropdown>().captionText.text, birth_date, BirthCityInputField.text, BirthCountryInputField.text); return(res); }
private bool CheckDropdownValueWasPicked(TMP_Dropdown dropdown) { if (dropdown.value == 0) { SetErrorColor(dropdown.GetComponent <Image>()); return(false); } return(true); }
void Start() { dropdown = dropdown.GetComponent <TMP_Dropdown>(); dropdown.options.Clear(); dropdown.options.Add(new TMP_Dropdown.OptionData("Select Destination")); map_id = PlayerPrefs.GetString("MAP_ID"); Debug.Log("MapID >> " + map_id); filePath = $"{Application.persistentDataPath}/Files/test.glb"; navController = this.GetComponent <NavController>(); if (map_id.Length > 0) { m_Sdk = ArwaySDK.Instance; if (m_Sdk.developerToken != null && m_Sdk.developerToken.Length > 0) { StartCoroutine(GetMapData(map_id)); } else { Debug.Log("***********\tDeveloper Token not valid!\t***********"); NotificationManager.Instance.GenerateError("Invalid Developer Token!!"); } } if (m_ARSpace == null) { m_ARSpace = new GameObject("ARSpace"); if (m_ARSpace == null) { Debug.Log("No AR Space found"); } } // Create WaypointsAndDestinations Group with an ARAnchor m_WaypointsAndDestinations = new GameObject("Waypoints & Destinations"); m_WaypointsAndDestinations.transform.parent = m_ARSpace.transform; // Create 3D Models Group with an ARAnchor m_3DModels = new GameObject("3D Models"); m_3DModels.transform.parent = m_ARSpace.transform; // Create Images Group with an ARAnchor m_Images = new GameObject("Images"); m_Images.transform.parent = m_ARSpace.transform; // Create Text Group with an ARAnchor m_Texts = new GameObject("Texts"); m_Texts.transform.parent = m_ARSpace.transform; }
public static void UiTextUpdate(TMP_Dropdown dd) { UiText onSelection = dd.GetComponent <UiText>(); if (onSelection == null) { return; } UnityEvent_string setText = onSelection.setText; HandleDropdown(dd.value, dd, setText); }
public void Init(ArgumentSpec argSpec, Argument arg, CodeList codeList) { this.arg = arg; // Configure dropdown options dropdown = GetComponent <TMP_Dropdown>(); TextMeshProUGUI tm = GetComponentInChildren <TextMeshProUGUI>(); float maxPreferredWidth = 0; if (argSpec.regOnly) { for (int regNum = 0; regNum < VirtualMachine.NUM_TOTAL_REGS; ++regNum) { string regName = "R" + regNum; dropdown.options.Add(new TMP_Dropdown.OptionData(regName)); maxPreferredWidth = Mathf.Max(tm.GetPreferredValues(regName).x, maxPreferredWidth); } } else { foreach (string presetName in argSpec.presets) { dropdown.options.Add(new TMP_Dropdown.OptionData(presetName)); maxPreferredWidth = Mathf.Max(tm.GetPreferredValues(presetName).x, maxPreferredWidth); } } // Register value change handlers Argument.Type argType = argSpec.regOnly ? Argument.Type.REGISTER : Argument.Type.IMMEDIATE; dropdown.onValueChanged.AddListener((int val) => { if (selfChange.Value) { return; } arg.val = val; selfChange.Value = true; arg.BroadcastChange(); codeList.Program.BroadcastArgumentChange(); }); arg.OnChange += HandleArgChange; // Init value HandleArgChange(); // Resize to fit the max preferred width RectTransform dropdownRT = dropdown.GetComponent <RectTransform>(); RectTransform labelRT = tm.GetComponent <RectTransform>(); dropdownRT.sizeDelta = new Vector2(maxPreferredWidth - labelRT.sizeDelta.x, dropdownRT.sizeDelta.y); }
public void OnFormationDropDownSelect() { foreach (FormationData data in formationData.List) { if (data.Name == formationNameList[formationDropdown.value]) { teamData.Formation = data; field.UpdateFormation(data); } } hasChanged = true; formationDropdown.GetComponent <Animator>().SetTrigger("Normal"); }
public void PopulateSpecific() { List <string> options = new List <string>(); switch (dd_itemType.value) { case 0: // Weapons dd_itemSpecific.ClearOptions(); foreach (Weapon.WeaponType t in Enum.GetValues(typeof(Weapon.WeaponType))) { options.Add(t.ToString()); armorClass.gameObject.SetActive(false); } dd_itemSpecific.AddOptions(options); break; case 1: // Armors dd_itemSpecific.ClearOptions(); if (armorClass.GetComponent <TMP_Dropdown>().options.Count == 0) { PopulateArmorClass(); } foreach (Armor.EquipmentSlot t in Enum.GetValues(typeof(Armor.EquipmentSlot))) { if (t.ToString() == "Weapon") { continue; } options.Add(t.ToString()); armorClass.gameObject.SetActive(true); } dd_itemSpecific.AddOptions(options); break; } }
private void Awake() { dropdown = dropdown.GetComponent <TMP_Dropdown>(); dropdown.ClearOptions(); Image[] imagesObj = gameObject.GetComponentsInChildren <Image>(); foreach (var item in imagesObj) { countryFlag.Add(item.sprite); countryName.Add(item.sprite.name); options.Add(new TMP_Dropdown.OptionData { image = item.sprite, text = item.sprite.name }); } dropdown.AddOptions(options); }
// Start is called before the first frame update void Start() { //mapDetails = GetComponent<MapDetails>(); var allMaps = GameManager.Instance.GetComponent <Maps>().allMapsDict; mapSelector.GetComponent <TMP_Dropdown>(); foreach (KeyValuePair <string, MapInfo> map in allMaps) { mapNames.Add(map.Key); } mapSelector.AddOptions(mapNames); mapSelector.value = 0; }
public void PopulateDropdown(List <String> PopulateList, Color32 newColor) { dropdown.ClearOptions(); dropdown.GetComponent <Image>().color = newColor; dropdown.transform.GetChild(4).GetComponent <Image>().color = newColor; for (int i = 0; i < PopulateList.Count; i++) { dropdown.options.Add(new TMP_Dropdown.OptionData() { text = PopulateList[i] }); } //this swith from 1 to 0 is only to refresh the visual DdMenu dropdown.value = 1; dropdown.value = 0; }
// Start is called before the first frame update void Start() { Button[] buttons = GameObject.FindObjectsOfType <Button>(); attackSelector.GetComponent <TMP_Dropdown>(); for (int i = 0; i < buttons.Length; i++) { buttons[i].interactable = false; } for (int b = 0; b < objectButtons.Length; b++) { objectButtons[b].interactable = true; } }
void Start() { m_Sdk = ArwaySDK.Instance; if (m_Sdk.developerToken != null && m_Sdk.developerToken.Length > 0) { NotificationManager.Instance.GenerateNotification("Getting Cloud List.."); StartCoroutine(GetCloudList()); } else { NotificationManager.Instance.GenerateError("Invalid Developer Token!"); } cloudDropdown = cloudDropdown.GetComponent <TMP_Dropdown>(); cloudDropdown.options.Clear(); cloudDropdown.options.Add(new TMP_Dropdown.OptionData("Select Cloud Map")); }
public override void Start() { base.Start(); iconRendere = transform.Find("Type").GetComponent <SpriteRenderer>(); dropdown = App.Instance.uiHandler.RequestDropdown(); dropdownRect = dropdown.GetComponent <RectTransform>(); int selected = 0; switch (gateType) { case GateType.And: selected = 0; iconRendere.sprite = and; break; case GateType.Not: selected = 1; iconRendere.sprite = not; input2.gameObject.SetActive(false); input1.transform.localPosition = new Vector3(input1.transform.localPosition.x, 0, input1.transform.localPosition.z); break; case GateType.Or: selected = 2; iconRendere.sprite = or; break; } dropdown.value = selected; dropdown.onValueChanged.AddListener(delegate { UpdateGateType(); }); DisableDropdown(); }
void Start() { try { this.txtPlayers.text = Localization.GetMessage("CreateParty", "Players"); this.txtGameMode.text = Localization.GetMessage("CreateParty", "GameMode"); this.txtSpeed.text = Localization.GetMessage("CreateParty", "Speed"); this.btnCreate.text = Localization.GetMessage("CreateParty", "Create"); this.btnBack.text = Localization.GetMessage("CreateParty", "Back"); } catch (KeyNotFoundException) { txtFeedBackMessage.text = "Translate Error"; } this._gameModeOptions = dpGameMode.GetComponent <TMP_Dropdown>().options; _player = (Player)Memory.Load("player"); InstanceRoom(); FillGameModes(); }
public void Init(ArgumentSpec argSpec, Argument arg) { // Configure dropdown options TMP_Dropdown dropdown = GetComponent <TMP_Dropdown>(); TextMeshProUGUI tm = GetComponentInChildren <TextMeshProUGUI>(); float maxPreferredWidth = 0; if (argSpec.regOnly) { for (int regNum = 0; regNum < VirtualMachine.NUM_REGS; ++regNum) { string regName = "R" + regNum; dropdown.options.Add(new TMP_Dropdown.OptionData(regName)); maxPreferredWidth = Mathf.Max(tm.GetPreferredValues(regName).x, maxPreferredWidth); } } else { foreach (string presetName in argSpec.presets) { dropdown.options.Add(new TMP_Dropdown.OptionData(presetName)); maxPreferredWidth = Mathf.Max(tm.GetPreferredValues(presetName).x, maxPreferredWidth); } } dropdown.value = arg.val; // Register value change handler Argument.Type argType = argSpec.regOnly ? Argument.Type.REGISTER : Argument.Type.IMMEDIATE; dropdown.onValueChanged.AddListener((int val) => { arg.val = val; }); // Resize to fit the max preferred width RectTransform dropdownRT = dropdown.GetComponent <RectTransform>(); RectTransform labelRT = tm.GetComponent <RectTransform>(); dropdownRT.sizeDelta = new Vector2(maxPreferredWidth - labelRT.sizeDelta.x, dropdownRT.sizeDelta.y); }
void Start() { renderCameraFeed(); m_Sdk = ArwaySDK.Instance; sessionCookieString = PlayerPrefs.GetString("COOKIE"); //Debug.Log("Cookies: " + sessionCookieString); if (m_Sdk.developerToken != null && m_Sdk.developerToken.Length > 0) { NotificationManager.Instance.GenerateNotification("Getting Cloud List.."); StartCoroutine(GetCloudList()); } else { NotificationManager.Instance.GenerateError("Invalid Developer Token!"); } cloudDropdown = cloudDropdown.GetComponent <TMP_Dropdown>(); cloudDropdown.options.Clear(); cloudDropdown.options.Add(new TMP_Dropdown.OptionData("Select Cloud Map")); }
public void ActivateDropDownSword() { //get component drop down of the option string type //store the string type to current of the press for the player to confirm selectedItem = swordDropDown.GetComponent <TMP_Dropdown>().captionText.text.ToString(); //add tool tip swordToolTip.gameObject.SetActive(true); //find text children name text, item level, rarity, and value for (int itemDatabase = 0; itemDatabase < itemDatabaseItemObj.ItemObjects.Length; itemDatabase++) { if (selectedItem == itemDatabaseItemObj.ItemObjects[itemDatabase].newItem.Name) { //set the text to the selected item property t_swordName.text = "Name: " + itemDatabaseItemObj.ItemObjects[itemDatabase].newItem.Name.ToString(); t_swordItemLevel.text = "Item Level: " + itemDatabaseItemObj.ItemObjects[itemDatabase].newItem.itemLevel.ToString(); t_swordRarity.text = "Item Rarity: " + itemDatabaseItemObj.ItemObjects[itemDatabase].CreateItem().itemRarity.ToString(); t_swordValue.text = "Item Damage: " + itemDatabaseItemObj.ItemObjects[itemDatabase].CreateItem().values.ToString(); t_itemPrice.text = itemDatabaseItemObj.ItemObjects[itemDatabase].newItem.itemPrice.ToString(); break; } } FindItemFromArrayOfGroundItem(); }
internal static void CreateMakerDropdownItems(List <string> labels) { Transform copy = GameObject.Find("ddASSList").transform; copy.gameObject.SetActive(false); TMP_Dropdown dropdown = copy.GetComponentInChildren <TMP_Dropdown>(); dropdown.onValueChanged.RemoveAllListeners(); dropdown.ClearOptions(); dropdown.GetComponent <Image>().raycastTarget = true; dropdown.options.AddRange(ddASSListLabels.Select(x => new TMP_Dropdown.OptionData(x))); dropdown.options.AddRange(labels.Select(x => new TMP_Dropdown.OptionData(x))); dropdown.value = 0; dropdown.onValueChanged.AddListener(_ => { ChaControl chaCtrl = MakerAPI.GetCharacterControl(); AccStateSyncController pluginCtrl = GetController(chaCtrl); AccTriggerInfo Part = pluginCtrl.CurSlotTriggerInfo; if (Part == null) { Logger.LogError($"[ddASSList][{chaCtrl.chaFile.parameter?.fullname}] AccessoriesApi.SelectedMakerAccSlot {AccessoriesApi.SelectedMakerAccSlot} out of range!!"); return; } int refIndex = dropdown.value < 10 ? dropdown.value : 9; GameObject.Find("tglASS0").GetComponentInChildren <TextMeshProUGUI>().alpha = clothesStates[refIndex][0] ? 1f : 0.2f; GameObject.Find("tglASS1").GetComponentInChildren <TextMeshProUGUI>().alpha = clothesStates[refIndex][1] ? 1f : 0.2f; GameObject.Find("tglASS2").GetComponentInChildren <TextMeshProUGUI>().alpha = clothesStates[refIndex][2] ? 1f : 0.2f; GameObject.Find("tglASS3").GetComponentInChildren <TextMeshProUGUI>().alpha = clothesStates[refIndex][3] ? 1f : 0.2f; Part.Kind = dropdown.value < 10 ? ddASSListVals[dropdown.value] : dropdown.value; MakerSettingChangePreview(chaCtrl, Part); Logger.Log(DebugLogLevel, $"[ddASSList][{chaCtrl.chaFile.parameter?.fullname}][Slot: {Part.Slot}][Kind: {Part.Kind}][State: {Part.State[0]}|{Part.State[1]}|{Part.State[2]}|{Part.State[3]}]"); }); copy.gameObject.SetActive(true); }
private void reset() { valuesDropdown1.GetComponent <Image>().color = new Color32(212, 216, 236, 255); valuesDropdown2.GetComponent <Image>().color = new Color32(212, 216, 236, 255); conditionsDropdown.GetComponent <Image>().color = new Color32(254, 255, 165, 255); }
public ParticipantRegistrationRequest GetRegistrationInfo() { DateTime birth_date = GetBirthDate(); ParticipantRegistrationRequest res = new ParticipantRegistrationRequest(birth_date, GenderDropdown.GetComponent <TMP_Dropdown>().captionText.text, NationalityInputField.text, AdditionInformationInputField.text); return(res); }
private void OnClick() { dropdown.GetComponent <SceneOptions>().gotoChosenScene(); }