Example #1
0
    private void boxItemClickHandler(GameObject go)
    {
        UI_LivenessBoxItem boxItem = go.GetComponent <UI_LivenessBoxItem>();

        if (boxItem == null)
        {
            return;
        }


        UI_LivenessBoxShow item = m_Rewards.GetComponent <UI_LivenessBoxShow>();

        if (boxItem.isOpend())
        {
            InterfaceControler.GetInst().AddMsgBox("已领取过该奖励", this.gameObject.transform);
        }
        else
        {
            m_Rewards.SetActive(true);
            item.Show(boxItem);
        }
    }
Example #2
0
    public void Show(UI_LivenessBoxItem item)
    {
        if (item == null)
        {
            return;
        }
        itm     = item;
        itemNum = heroNum = 0;
        if (item.canOpen())
        {
            if (!item.isOpend())
            {
                mHeader.text = "奖励确认";
                mCloseImage.overrideSprite = UIResourceMgr.LoadSprite(common.defaultPath + "UI_xuanze");
                mCloseText.text            = GameUtils.getString("common_button_receive");//领  取
            }
            else
            {
                InterfaceControler.GetInst().AddMsgBox("已领取过该奖励", this.gameObject.transform);
                return;
            }
        }
        else
        {
            mHeader.text = GameUtils.getString("activity_content1");
            mCloseImage.overrideSprite = UIResourceMgr.LoadSprite(common.defaultPath + "UI_xuanze");
            mCloseText.text            = GameUtils.getString("common_button_close"); //关  闭
        }

        int id = DataTemplate.GetInstance().m_GameConfig.getActivitymission_reward_drop()[item.Index];

        int[] innerdropList = ((NormaldropTemplate)DataTemplate.GetInstance().m_NormaldropTable.getTableData(id)).getInnerdrop();
        Dictionary <int, IExcelBean> innerIExcel = DataTemplate.GetInstance().m_InnerdropTable.getData();

        mDropList.Clear();
        //for (int i = 0; i < innerdropList.Length; i++)
        //{
        //    Debug.Log(111);
        //    foreach (var value in innerIExcel.Values)
        //    {
        //        if (((InnerdropTemplate)value).getInnerdropid() == innerdropList[i])
        //        {
        //            mDropList.Add((InnerdropTemplate)value);

        //            int itemid = ((InnerdropTemplate)value).getObjectid();
        //            int type = itemid / 1000000;
        //            if (type == (int)EM_OBJECT_CLASS.EM_OBJECT_CLASS_RUNE)
        //                itemNum++;
        //            if (type == (int)EM_OBJECT_CLASS.EM_OBJECT_CLASS_HERO)
        //                heroNum++;
        //        }
        //    }
        //}
        for (int i = 0, j = innerdropList.Length; i < j; i++)
        {
            foreach (int k in DataTemplate.GetInstance().m_InnerdropTable.GetDataKeys())
            {
                InnerdropTemplate _it = (InnerdropTemplate)DataTemplate.GetInstance().m_InnerdropTable.getTableData(k);

                if (_it == null)
                {
                    continue;
                }

                if (_it.getInnerdropid() == innerdropList[i])
                {
                    mDropList.Add(_it);
                }
            }
        }
        CreatBoxItem();
    }