using UnityEngine;
using UnityEngine.UI;
public class DropD1 : MonoBehaviour
{
/*
* В масивах:
* 0 - ice
* 1 - wood
* 2 - rubber
* 3 - grass
*/
[SerializeField] private Dropdown dropdown;
[SerializeField] private string isSelected;
[SerializeField] private SphereCollider[] material;
[SerializeField] private string[] materialNames;
public void Click()
{
int index = dropdown.value;
for (int i = 0; i < material.Length; i++)
{
material[i].enabled = false;
}
material[index].enabled = true;
isSelected = ($"Выбран {materialNames[index]}");
}
}