using UnityEngine; using System.Collections; using System.Collections.Generic; using UnityEngine.UI; using UnityEngine.EventSystems; public class RegionSelector : MonoBehaviour { private readonly Dictionary regions = new Dictionary { { "Padrão Nacional", "" }, { "Acre", "AC/" }, { "Alagoas", "AL/" }, { "Amapá", "AP/" }, { "Amazonas", "AM/" }, { "Bahia", "BA/" }, { "Ceará", "CE/" }, { "Distrito Federal", "DF/" }, { "Espírito Santo", "ES/" }, { "Goiás", "GO/" }, { "Maranhão", "MA/" }, { "Mato Grosso", "MT/" }, { "Mato Grosso do Sul", "MS/" }, { "Minas Gerais", "MG/" }, { "Pará", "PA/" }, { "Paraíba", "PB/" }, { "Paraná", "PR/"}, { "Pernambuco", "PE/" }, { "Piauí", "PI/" }, { "Rio de Janeiro", "RJ/" }, { "Rio Grande do Norte", "RN/" }, { "Rio Grande do Sul", "RS/" }, { "Rondônia", "RO/" }, { "Roraima", "RR/" }, { "Santa Catarina", "SC/" }, { "São Paulo", "SP/" }, { "Sergipe", "SE/" }, { "Tocantins", "TO/" } }; public PlayerManager manager; public GameObject list; public GameObject SampleItem; public Text label; private Region activeItem = null; private Region selectedItem = null; void Start () { foreach (KeyValuePair regionData in regions) { GameObject item = Instantiate(this.SampleItem) as GameObject; item.GetComponentInChildren().text = regionData.Key; item.transform.SetParent(this.list.transform); item.GetComponent