public TileTageDataObject NewTileTageDataObject(string currentSelectedTile) { TileTageDataObject t = Instantiate <TileTageDataObject>(tiletag_prefab, panel.contentTransform); t.InitTagObj(currentSelectedTile, editPanel); t.dropdown.ClearOptions(); int x = 0; // add all options here // select the approriate option for (int i = 0; i < editPanel.creationManager.currentCampaign.properties.Count; i++) { t.dropdown.options.Add( new TMPro.TMP_Dropdown.OptionData(editPanel.creationManager.currentCampaign.properties[i])); } t.dropdown.value = 0; TMP_Dropdown.OptionData[] temp = t.dropdown.options.ToArray(); //for t.dropdown.RefreshShownValue(); return(t); }
public void OnNewTagClicked() { // delete new button if (newtag_button_instance != null) { Destroy(newtag_button_instance.gameObject); } //create tew tile tag objects TileTageDataObject obj = NewTileTageDataObject(""); tag_buttons.Add(obj); // create new button PrintNewTileButton(); }
public void InitDisplay(EditTileTypesPanel editTileTypesPanel) { gameObject.SetActive(true); this.editPanel = editTileTypesPanel; ClearButtons(); foreach (string ket in editPanel.GetCurrentTileType().attributes) { TileTageDataObject obj = NewTileTageDataObject(ket); tag_buttons.Add(obj); } PrintNewTileButton(); }
public void DestoryBUtton(TileTageDataObject obj) { tag_buttons.Remove(obj); Destroy(obj.gameObject); }