I'm having trouble setting up the dropdown menù buttons with a dialog.
The behaviour I'm trying to get is this one:
> Click on dropdown menù
> Click on one of the three buttons
> For every button I should get a different dialog
I'm currently using this code, I wrote using the video tutorial from Youtube:
using UnityEngine;
using MaterialUI;
public class DialogScript : MonoBehaviour {
[SerializeField] private MaterialDropdown m_Dropdown;
[SerializeField] private Sprite[] m_IconSpriteArray;
public void SelectedItem(int index = 0)
{
DialogManager.ShowAlert("statement 1", "title 1", MaterialIconHelper.GetIcon("mood"));
}
public void SelectedItem2(int index = 1)
{
DialogManager.ShowAlert("statement 2", "title 2", MaterialIconHelper.GetIcon("insert_drive_file"));
}
public void SelectedItem3(int index = 2)
{
DialogManager.ShowAlert("statement 3", "title 3", MaterialIconHelper.GetIcon("free_breakfast"));
}
}
The int index = 0 should represent the option from the dropdown menù (at least in my mind), but with this written when I click on one button it opens 3 dialogs at the same time, could you please lead me?