Exemplo n.º 1
0
    private void SetOneCell(int cellIndex, RawInfo rawInfo)
    {
        GameObject instantiate2Prefab = ResourceManager.GetInstantiate2Prefab("Activity7DayCell");

        instantiate2Prefab.get_transform().SetParent(this.scroll, false);
        instantiate2Prefab.get_gameObject().SetActive(true);
        instantiate2Prefab.set_name(cellIndex.ToString());
        Transform btnGet = instantiate2Prefab.get_transform().FindChild("btnGet");

        btnGet.GetComponent <Button>().get_onClick().RemoveAllListeners();
        btnGet.GetComponent <Button>().get_onClick().AddListener(delegate
        {
            this.OnClickBtnGet(btnGet.get_gameObject());
        });
        this.SetBtnGet(btnGet, cellIndex);
        Transform  transform  = instantiate2Prefab.get_transform().FindChild("north").FindChild("txtCondition");
        string     text       = GameDataUtils.GetChineseContent((int)rawInfo.chineseId, false);
        List <int> needParams = rawInfo.needParams;

        if (rawInfo.tab == Tab.TAB.PlayPass)
        {
            if (rawInfo.subTab == SubTab.ST.EliteDungeon)
            {
                JingYingFuBenPeiZhi jingYingFuBenPeiZhi = DataReader <JingYingFuBenPeiZhi> .Get(needParams.get_Item(0));

                if (jingYingFuBenPeiZhi != null)
                {
                    JJingYingFuBenQuYu jJingYingFuBenQuYu = DataReader <JJingYingFuBenQuYu> .Get(jingYingFuBenPeiZhi.map);

                    string chineseContent = GameDataUtils.GetChineseContent(jingYingFuBenPeiZhi.bossName, false);
                    text = string.Format(text, chineseContent);
                }
            }
        }
        else
        {
            string[] array = new string[needParams.get_Count()];
            for (int i = 0; i < needParams.get_Count(); i++)
            {
                int grade = needParams.get_Item(i);
                if (i == 1 && rawInfo.subTab == SubTab.ST.PetUpStage)
                {
                    array[i] = this.GetPetGrade(grade);
                }
                else
                {
                    array[i] = grade.ToString();
                }
            }
            text = string.Format(text, array);
        }
        transform.GetComponent <Text>().set_text(text);
        ItemInfo1 rewardItem = rawInfo.rewardItem;
        Transform parent     = instantiate2Prefab.get_transform().FindChild("imgGrid");

        if (rewardItem != null)
        {
            ItemShow.ShowItem(parent, rewardItem.itemId, (long)rewardItem.count, false, UINodesManager.T2RootOfSpecial, 2001);
        }
    }
Exemplo n.º 2
0
    private void OnClickImgBox(GameObject go)
    {
        int boxFlag = Activity7DayManager.Instance.boxFlag;

        if (boxFlag != 0)
        {
            if (boxFlag == 1)
            {
                Activity7DayManager.Instance.SendGetOpenServerBoxReq();
            }
        }
        else
        {
            List <int>  list  = new List <int>();
            List <long> list2 = new List <long>();
            for (int i = 0; i < Activity7DayManager.Instance.boxItems.get_Count(); i++)
            {
                ItemInfo1 itemInfo = Activity7DayManager.Instance.boxItems.get_Item(i);
                list.Add(itemInfo.itemId);
                list2.Add((long)itemInfo.count);
            }
            RewardUI rewardUI = UIManagerControl.Instance.OpenUI("RewardUI", UINodesManager.TopUIRoot, false, UIType.NonPush) as RewardUI;
            rewardUI.SetRewardItem(GameDataUtils.GetChineseContent(513163, false), list, list2, true, false, null, null);
            rewardUI.SetTipsText(GameDataUtils.GetChineseContent(513197, false));
        }
    }