Example #1
0
 public CUseable GetExtraUseable(int index)
 {
     if (this.ExtraRewardDrop != null && index < this.ExtraRewardCount)
     {
         ResDT_RandomRewardInfo resDT_RandomRewardInfo = this.ExtraRewardDrop.astRewardDetail[index];
         return(CUseableManager.CreateUsableByRandowReward(resDT_RandomRewardInfo.bItemType, (int)resDT_RandomRewardInfo.dwLowCnt, resDT_RandomRewardInfo.dwItemID));
     }
     return(null);
 }
Example #2
0
 public CUseable GetUseable(int index)
 {
     if ((this.RewardDrop != null) && (index < this.RewardCount))
     {
         ResDT_RandomRewardInfo info = this.RewardDrop.astRewardDetail[index];
         return(CUseableManager.CreateUsableByRandowReward((RES_RANDOM_REWARD_TYPE)info.bItemType, (int)info.dwLowCnt, info.dwItemID));
     }
     return(null);
 }
Example #3
0
 public uint GetDropCount(int index)
 {
     if (this.RewardDrop != null)
     {
         ResDT_RandomRewardInfo resDT_RandomRewardInfo = this.RewardDrop.astRewardDetail[index];
         if (resDT_RandomRewardInfo.dwLowCnt == resDT_RandomRewardInfo.dwHighCnt)
         {
             return(resDT_RandomRewardInfo.dwLowCnt);
         }
     }
     return(0u);
 }
Example #4
0
        public void SetData(GameObject root, CUIFormScript formScript)
        {
            ResRandomRewardStore dataByKey = GameDataMgr.randowmRewardDB.GetDataByKey(0xa029);

            for (int i = 0; i < 3; i++)
            {
                string                 name        = string.Format("Panel/QQVip/AwardGrid/QQ/ListElement{0}/ItemCell", i);
                GameObject             gameObject  = root.transform.FindChild(name).gameObject;
                ResDT_RandomRewardInfo info        = dataByKey.astRewardDetail[i];
                CUseable               itemUseable = CUseableManager.CreateUsableByRandowReward((RES_RANDOM_REWARD_TYPE)info.bItemType, (int)info.dwLowCnt, info.dwItemID);
                if (itemUseable != null)
                {
                    if (gameObject.GetComponent <CUIEventScript>() == null)
                    {
                        gameObject.AddComponent <CUIEventScript>();
                    }
                    CUICommonSystem.SetItemCell(formScript, gameObject, itemUseable, true, false);
                }
            }
            ResRandomRewardStore store2 = GameDataMgr.randowmRewardDB.GetDataByKey(0xa02a);

            for (int j = 0; j < 3; j++)
            {
                string                 str2     = string.Format("Panel/QQVip/AwardGrid/QQVip/ListElement{0}/ItemCell", j);
                GameObject             itemCell = root.transform.FindChild(str2).gameObject;
                ResDT_RandomRewardInfo info2    = store2.astRewardDetail[j];
                CUseable               useable2 = CUseableManager.CreateUsableByRandowReward((RES_RANDOM_REWARD_TYPE)info2.bItemType, (int)info2.dwLowCnt, info2.dwItemID);
                if (useable2 != null)
                {
                    if (itemCell.GetComponent <CUIEventScript>() == null)
                    {
                        itemCell.AddComponent <CUIEventScript>();
                    }
                    CUICommonSystem.SetItemCell(formScript, itemCell, useable2, true, false);
                }
            }
            this.m_BtnQQ = root.transform.FindChild("Panel/QQVip/AwardGrid/QQ/Button/").gameObject;
            Text      componentInChildren = root.transform.FindChild("Panel/QQVip/AwardGrid/QQVip/Button/").gameObject.GetComponentInChildren <Text>();
            CRoleInfo masterRoleInfo      = Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo();

            if (masterRoleInfo != null)
            {
                if (masterRoleInfo.HasVip(0x10))
                {
                    if (this.m_BtnQQ.activeInHierarchy)
                    {
                        this.m_BtnQQ.GetComponentInChildren <Text>().text = "续费QQ会员";
                    }
                    componentInChildren.text = "续费超级会员";
                }
                else if (masterRoleInfo.HasVip(1))
                {
                    if (this.m_BtnQQ.activeInHierarchy)
                    {
                        this.m_BtnQQ.GetComponentInChildren <Text>().text = "续费QQ会员";
                    }
                    componentInChildren.text = "开通超级会员";
                }
                else if (!masterRoleInfo.HasVip(1))
                {
                    if (this.m_BtnQQ.activeInHierarchy)
                    {
                        this.m_BtnQQ.GetComponentInChildren <Text>().text = "开通QQ会员";
                    }
                    componentInChildren.text = "开通超级会员";
                }
            }
        }