Пример #1
0
    private void ShowImagesInBundle(string bundleId, string m_imageIdToCenter, string m_imageIdToComplete)
    {
        m_bundleListView.gameObject.SetActive(false);
        m_imagesPanel.gameObject.SetActive(true);

        var game = Pix.Game.GetInstance();

        var bundle = game.ImageManager.GetBundleById(bundleId);

        if (bundle == null)
        {
            return;
        }

        m_selectedBundleId = bundleId;

        var images = bundle.GetImages();

        if (images == null)
        {
            return;
        }

        List <ImageViewData> imageViewDataList = new List <ImageViewData>();

        foreach (var image in images)
        {
            var imageViewData = CreateImageViewData(image, m_selectedBundleId);
            imageViewDataList.Add(imageViewData);
        }

        m_topBarTitle.text = bundle.Name;

        bool storeMode = !game.ImageManager.IsBundleAvailable(bundleId);

        m_imageListView.Init(imageViewDataList, storeMode, GetLocalizedPrice(bundle.ProductId));

        if (!string.IsNullOrEmpty(m_imageIdToCenter))
        {
            m_imageListView.ScrollToImage(m_imageIdToCenter);
        }

        // Play COMPLETED animation if needed
        if (!string.IsNullOrEmpty(m_imageIdToComplete))
        {
            var imageView = m_imageListView.GetImageView(m_imageIdToComplete);
            if (imageView != null)
            {
                imageView.ShowCompletedIndicator(true, true);
            }
        }
    }