Ejemplo n.º 1
0
    private void BindProvince()
    {
        provinces = PlaceUtility.GetProvinces();

        if (provinces != null)
        {
            this.InvokeToForm(() =>
            {
                comboBoxProvince.ClearOptions();
                var list = new List <Dropdown.OptionData>();
                foreach (var item in provinces)
                {
                    var option  = new Dropdown.OptionData();
                    option.text = item.Name;
                    list.Add(option);
                }
                comboBoxProvince.AddOptions(list);
                if (comboBoxProvince.value != 0)
                {
                    comboBoxProvince.value = 0;
                }
                else
                {
                    ComboBoxProvince_SelectedIndexChanged(0);
                }
            });
        }
    }
Ejemplo n.º 2
0
    void Sync()
    {
        var provinces = PlaceUtility.GetProvinces();

        foreach (var province in provinces)
        {
            var citys = PlaceUtility.GetCitys(province);
            foreach (var city in citys)
            {
                var directs = PlaceUtility.GetDistricts(province, city);
                foreach (var direct in directs)
                {
                    Debug.Log(string.Format("{0}/{1}/{2}", province.Name, city.Name, direct.Name));
                }
            }
        }
    }