Exemple #1
0
        // Token: 0x060132B7 RID: 78519 RVA: 0x004E2804 File Offset: 0x004E0A04
        public static GoodsUIController CreateRewardGoods(Goods g, Transform parent, GameObject prefab, bool showCount = true, Action <GoodsUIController> onGoodsClick = null)
        {
            if (prefab == null)
            {
                return(null);
            }
            GameObject        go = UnityEngine.Object.Instantiate <GameObject>(prefab, parent, false);
            GoodsUIController goodsUIController = GameObjectUtility.AddControllerToGameObject <GoodsUIController>(go);

            goodsUIController.SetReward(g);
            goodsUIController.ShowCount(showCount);
            goodsUIController.OnClickEvent = onGoodsClick;
            return(goodsUIController);
        }
Exemple #2
0
        // Token: 0x0600FA1B RID: 64027 RVA: 0x0041D2B8 File Offset: 0x0041B4B8
        public void SetSelfChooseItemBuyPlane(StoreId storeId, int fixedStoreItemId)
        {
            this.m_storeId          = storeId;
            this.m_fixedStoreItemId = fixedStoreItemId;
            ConfigDataFixedStoreItemInfo  configDataFixedStoreItemInfo  = this.m_configDataLoader.GetConfigDataFixedStoreItemInfo(fixedStoreItemId);
            ConfigDataItemInfo            configDataItemInfo            = this.m_configDataLoader.GetConfigDataItemInfo(configDataFixedStoreItemInfo.ItemId);
            ConfigDataSelfSelectedBoxInfo configDataSelfSelectedBoxInfo = this.m_configDataLoader.GetConfigDataSelfSelectedBoxInfo(configDataItemInfo.FuncTypeParam1);

            foreach (Goods g in configDataSelfSelectedBoxInfo.Reward)
            {
                GoodsUIController item = GoodsUIController.CreateRewardGoods(g, this.m_content, this.m_itemTemplate, true, new Action <GoodsUIController>(this.OnGoodsClick));
                this.m_goodUIControllerList.Add(item);
            }
        }
        // Token: 0x06013698 RID: 79512 RVA: 0x004F270C File Offset: 0x004F090C
        private void OnGoodsClick(GoodsUIController goodsUIController)
        {
            int selfChooseItemIndex = -1;

            for (int i = 0; i < this.m_goodUIController.Count; i++)
            {
                if (this.m_goodUIController[i] == goodsUIController)
                {
                    selfChooseItemIndex = i;
                    break;
                }
            }
            this.m_storeListUIController.m_selfChooseItemIndex = selfChooseItemIndex;
            this.m_storeListUIController.SetNormalItemBuyPanel(goodsUIController.m_goods, this.m_storeItemUIController);
        }
Exemple #4
0
 // Token: 0x060132B8 RID: 78520 RVA: 0x004E2848 File Offset: 0x004E0A48
 public static void CreateRewardGoodsList(List <Goods> goods, Transform parent, GameObject prefab, List <GoodsUIController> ctrlList = null, bool showCount = true)
 {
     if (prefab == null)
     {
         return;
     }
     prefab.SetActive(true);
     foreach (Goods g in goods)
     {
         GoodsUIController goodsUIController = GoodsUIController.CreateRewardGoods(g, parent, prefab, showCount, null);
         if (goodsUIController != null && ctrlList != null)
         {
             ctrlList.Add(goodsUIController);
         }
     }
 }
Exemple #5
0
        // Token: 0x0600FA1C RID: 64028 RVA: 0x0041D37C File Offset: 0x0041B57C
        private void OnGoodsClick(GoodsUIController goodsUIController)
        {
            int arg = -1;

            for (int i = 0; i < this.m_goodUIControllerList.Count; i++)
            {
                if (this.m_goodUIControllerList[i] == goodsUIController)
                {
                    arg = i;
                    break;
                }
            }
            if (this.EventOnSelfBoxChoose != null)
            {
                this.EventOnSelfBoxChoose(this.m_storeId, this.m_fixedStoreItemId, arg);
            }
        }
        // Token: 0x06013696 RID: 79510 RVA: 0x004F25C8 File Offset: 0x004F07C8
        public void SetSelfChooseItemID(StoreId storeID, StoreItemUIController storeItemUIController)
        {
            UIUtility.SetUIStateOpen(this.m_uiStateController, "Show", null, false, true);
            foreach (GoodsUIController goodsUIController in this.m_goodUIController)
            {
                UnityEngine.Object.Destroy(goodsUIController.gameObject);
            }
            this.m_goodUIController.Clear();
            this.m_storeItemUIController = storeItemUIController;
            ConfigDataItemInfo            configDataItemInfo            = this.m_configDataLoader.GetConfigDataItemInfo(storeItemUIController.m_goodsID);
            ConfigDataSelfSelectedBoxInfo configDataSelfSelectedBoxInfo = this.m_configDataLoader.GetConfigDataSelfSelectedBoxInfo(configDataItemInfo.FuncTypeParam1);

            foreach (Goods g in configDataSelfSelectedBoxInfo.Reward)
            {
                GoodsUIController item = GoodsUIController.CreateRewardGoods(g, this.m_content, this.m_itemTemplate, true, new Action <GoodsUIController>(this.OnGoodsClick));
                this.m_goodUIController.Add(item);
            }
        }