예제 #1
0
    void SetCardDate(byte LotteryID)
    {
        tagLotteryOnce tagLottery = new tagLotteryOnce();

        if (FishConfig.Instance.m_LotteryConfig.LotteryMap.ContainsKey(LotteryID) == true)
        {
            tagLottery = FishConfig.Instance.m_LotteryConfig.LotteryMap[LotteryID];
        }
        for (byte i = 0; i < tagLottery.RewardVec.Count; ++i)
        {
            cardsObj[i] = m_BaseTrans.GetChild(0).GetChild(i).gameObject;
            tagRewardOnce pReward = FishConfig.Instance.m_RewardConfig.RewardMap[tagLottery.RewardVec[i].RewardID];
            RewardIDList.Add(tagLottery.RewardVec[i].RewardID);
            if (pReward == null)
            {
                continue;
            }
            uint          itemID = pReward.RewardItemVec[0].ItemID;
            tagItemConfig pItme  = FishConfig.Instance.m_ItemInfo.m_ItemMap[itemID];
            if (pItme == null)
            {
                continue;
            }
            CardItem item = new CardItem();
            item.m_IconName = pItme.ItemIcon;
            if (pItme.ItemTypeID == EItemType.IT_Globel)
            {
                item.m_NameStr = "金币";
            }
            else if (pItme.ItemTypeID == EItemType.IT_Currey)
            {
                item.m_NameStr = "钻石";
            }
            else
            {
                item.m_NameStr = pItme.ItemName;
            }
            item.m_NumStr = pReward.RewardItemVec[0].ItemSum.ToString();
            item.InitItem(cardsObj[i].transform.GetChild(0).GetChild(0).gameObject);
            cardsObj[i].transform.GetChild(0).GetChild(0).gameObject.SetActive(true);
        }
    }
예제 #2
0
    void ShowOtherCard(int RewardID)
    {
        tagLotteryOnce tagLottery = new tagLotteryOnce();

        if (FishConfig.Instance.m_LotteryConfig.LotteryMap.ContainsKey(level) == true)
        {
            tagLottery = FishConfig.Instance.m_LotteryConfig.LotteryMap[level];
        }
        for (byte i = 0; i < tagLottery.RewardVec.Count; ++i)
        {
            int id = tagLottery.RewardVec[i].RewardID;
            if (cardsObj[i].transform.GetChild(0).gameObject != chooseCard && RewardIDList.Count != 0)
            {
                System.Random rand  = new System.Random();
                int           index = rand.Next(0, RewardIDList.Count);
                ShowOneCard((ushort)RewardIDList[index], cardsObj[i].transform.GetChild(0).gameObject);
                RewardIDList.RemoveAt(index);
            }
        }
    }
예제 #3
0
    void SetScrollViewDate()
    {
        tagLotteryOnce tagLottery = new tagLotteryOnce();

        if (FishConfig.Instance.m_LotteryConfig.LotteryMap.ContainsKey((byte)chooseLevel) == true)
        {
            tagLottery = FishConfig.Instance.m_LotteryConfig.LotteryMap[(byte)chooseLevel];
        }
        for (byte i = 0; i < tagLottery.RewardVec.Count; ++i)
        {
            tagRewardOnce pReward = FishConfig.Instance.m_RewardConfig.RewardMap[tagLottery.RewardVec[i].RewardID];
            if (pReward == null)
            {
                continue;
            }
            uint          itemID = pReward.RewardItemVec[0].ItemID;
            tagItemConfig pItme  = FishConfig.Instance.m_ItemInfo.m_ItemMap[itemID];
            if (pItme == null)
            {
                continue;
            }
            LotteryDrawItem item = new LotteryDrawItem();
            item.m_IconName = pItme.ItemIcon;
            item.m_NumStr  += pReward.RewardItemVec[0].ItemSum;
            if (pItme.ItemTypeID == EItemType.IT_Globel)
            {
                item.m_NumStr += "金币";
            }
            else if (pItme.ItemTypeID == EItemType.IT_Currey)
            {
                item.m_NumStr += "钻石";
            }
            else
            {
                item.m_NumStr += pItme.ItemName;
            }
            Transform Item = item.Init(ItemObj);
            Grid.AddChild(Item);
            Item.localScale = Vector3.one;
        }
    }