示例#1
0
        /// <summary>
        /// Initialize the Category
        /// </summary>
        /// <param name="_categoryData"></param>
        /// <param name="_subCategoryDotsZoneParent"></param>
        /// <param name="_scrollRect"></param>
        public void Initialize(CategoryData _categoryData, Transform _subCategoryDotsZoneParent, ScrollRect _scrollRect)
        {
            shopView           = ShopView.Instance;
            payments           = new List <Payment>();
            subCategoryVisuals = new List <SubCategoryVisual>();
            scrollRect         = (ScrollRectSwipe)_scrollRect;
            toggleGroup        = GetComponent <ToggleGroup>();
            layoutGroup        = GetComponent <LayoutGroup>();

//            List<SubCategoryDataServer> categoryDataServers = RemoteConfigManager.Instance.List<SubCategoryDataServer>();
//            categoryDataServers.AddRange(RemoteConfigManager.Instance.List<SubCategoryDataSkinServer>());
//            categoryDataServers.AddRange(RemoteConfigManager.Instance.List<SubCategoryDataBundleServer>());

            for (int i = 0; i < _categoryData.subCategories.Count; i++)
            {
                SubCategoryData subCategoryData = _categoryData.subCategories[i];
                if (subCategoryData != null)
                {
//                    SubCategoryDataServer categoryDataServer = categoryDataServers.Find(x => x.id == subCategoryData.id);
//                    if (categoryDataServer != null)
//                        subCategoryData.Initialize(categoryDataServer);

                    SubCategoryVisual subCategoryVisual = subCategoryData.AddSubCategory(transform);
                    subCategoryVisuals.Add(subCategoryVisual);
                    payments.Add(subCategoryData.payment);
                }
            }

            scrollRect.content = GetComponent <RectTransform>();

            UpdateToggleGroup(_categoryData);
            InitDots(_categoryData, _subCategoryDotsZoneParent);
        }
示例#2
0
        private void Init()
        {
            shop        = Shop.Instance;
            skinManager = SkinManager.Instance;
            shopView    = ShopView.Instance;

            shop.OnPurchaseRequested += OnPurchaseRequested;
        }
示例#3
0
        /// <summary>
        /// If you deactivate the InitializeOnAwake boolean,
        /// you will need to call this method to initialize the ShopManager
        /// </summary>
        public void Initialize()
        {
            shopView           = ShopView.Instance;
            skinManager        = SkinManager.Instance;
            currencyManager    = CurrencyManager.Instance;
            shopPurchaseHelper = ShopPurchaseHelper.Instance;

            currentlyUsedSkins = InitSelectedSkins();

            shopView.CreateVisualShop(shopData);

            StartCoroutine(DelayedInitialization());
        }