コード例 #1
0
        private void OnRegionDownload(RegionList list)
        {
            loadingUI.Hide();

            if (list == null)
            {
                loginUI.ShowError("Login Error!");
                loginUI.Show();

                return;
            }

            List <BlockListData> uiDataList = new List <BlockListData>();

            for (int i = 0; i < list.Regions.Count; i++)
            {
                RegionList.Region region = list.Regions[i];

                RegionItemData data = new RegionItemData();
                data.name = region.RegionName;
                data.data = region;

                uiDataList.Add(data);
            }
            regionList.SetData(uiDataList, 1, uiDataList.Count);

            regionList.Show();
        }
コード例 #2
0
ファイル: StorageUI.cs プロジェクト: bianshifeng/DataMesh
        public void ChangeUIData()
        {
            if (manager.listResult != null)
            {
                List <BlockListData> uiDataList = new List <BlockListData>();

                if (manager.totalCount > 0)
                {
                    Debug.Log("data len=" + manager.listResult.Count);

                    for (int i = 0; i < manager.listResult.Count; i++)
                    {
                        BaseResource res = manager.listResult[i];

                        BlockListData data = new BlockListData();
                        data.name = res.name;
                        data.data = res;
                        for (int j = 0; j < res.thumbnails.Length; j++)
                        {
                            if (res.thumbnails[j] != null)
                            {
                                data.icon = ImageHelper.GetImageUrl("http://" + manager.serverHost, res.thumbnails[j]);
                                break;
                            }
                        }

                        uiDataList.Add(data);
                    }
                }

                ui.SetData(uiDataList, manager.curPage, manager.totalCount);
            }
        }