Exemple #1
0
        public override void Setup(ViewData data)
        {
            base.Setup(data);
            var historyList = data.UserData as List <HistoryEntry>;

            if (historyList == null || historyList.Count == 0)
            {
                fallbackView.Activate();
            }
            else
            {
                fallbackView.Deactivate();
            }

            itemList.Setup(viewPrefab, layout, (itemdata, view) => {
                view.Setup(itemdata);
            }, (data1, data2) => {
                return(data1.PlanetId == data2.PlanetId && data1.Interval == data2.Interval);
            });
            itemList.Fill(data.UserData as List <HistoryEntry>);
            closeButton.SetListener(() => {
                Services.SoundService.PlayOneShot(SoundName.click);
                Services.ViewService.Remove(ViewType.HistoryView, BosUISettings.Instance.ViewCloseDelay);
                closeButton.interactable = false;
            });
        }
        private void Setup()
        {
            var products = Services.ResourceService.PersonalProducts.GetProducts(productType);

            if (itemList.Count != products.Count)
            {
                itemList.Setup(productViewPrefab, layout, (prod, view) => view.Setup(prod),
                               (prod1, prod2) => prod1.id == prod2.id, (prod1, prod2) => prod1.id.CompareTo(prod2.id), Services);
                itemList.Fill(products, 0.2f);
            }
        }
Exemple #3
0
        public void Setup(CoinListData coinListData)
        {
            var orderedItems = coinListData.Items.Where(data => IsNotTeleportWhenEarthOrMoon(data)).OrderBy(val => val.Order).ThenBy(val => val.Id).ToList();

            if (!isInitialized)
            {
                itemList.IsCorrectScale      = true;
                itemList.CorrectedScaleValue = Vector3.one;
                itemList.Setup(itemPrefab,
                               layout,
                               (data, view) => view.Setup(data, itemList),
                               (d1, d2) => d1.Id == d2.Id,
                               (d1, d2) => d1.Id.CompareTo(d2.Id),
                               Services);
                itemList.Fill(orderedItems, 0.05f);
                isInitialized = true;
            }
            if (coinListData.CoinUpgradeId != 0)
            {
                StartCoroutine(SetupImpl(coinListData.CoinUpgradeId));
            }
        }