Hello Nina,
yes I looked at the Unity scripting API and cannot figure out the problem.
As you can see the value field is public:
namespace TMPro
{
[AddComponentMenu(“UI/Dropdown - TextMeshPro”, 35)]
[RequireComponent(typeof(RectTransform))]
public class TMP_Dropdown : Selectable, IPointerClickHandler, IEventSystemHandler, ISubmitHandler, ICancelHandler
{
protected TMP_Dropdown();
public RectTransform template { get; set; }
public TMP_Text captionText { get; set; }
public bool IsExpanded { get; }
public int value { get; set; }
public DropdownEvent onValueChanged { get; set; }
public Image captionImage { get; set; }
public TMP_Text itemText { get; set; }
public Image itemImage { get; set; }
public List<OptionData> options { get; set; }
and the code doesn’t give me any error while I’m setting the value:
private void Start()
{
dropdown.value = -1;
i = dropdown.value;
}
The point is that actually I cannot set a value external to the lenght of the Options as described in my previous message.
Any suggestion?
Thanks
Fabio