示例#1
0
        public void RequestAnimation()
        {
            RaidQuestResult dataOfClass = DataSource.FindDataOfClass <RaidQuestResult>(((Component)this).get_gameObject(), (RaidQuestResult)null);

            if (dataOfClass == null)
            {
                this.mFinished = true;
            }
            else
            {
                if (this.IsRequest() || this.IsFinished())
                {
                    return;
                }
                this.mRequest = true;
                if (Object.op_Inequality((Object)this.TxtTitle, (Object)null))
                {
                    this.TxtTitle.set_text(string.Format(LocalizedText.Get("sys.RAID_RESULT_INDEX"), (object)(dataOfClass.index + 1)));
                }
                if (Object.op_Inequality((Object)this.TxtExp, (Object)null))
                {
                    this.TxtExp.set_text(dataOfClass.uexp.ToString());
                }
                if (Object.op_Inequality((Object)this.TxtGold, (Object)null))
                {
                    this.TxtGold.set_text(dataOfClass.gold.ToString());
                }
                if (dataOfClass.drops != null)
                {
                    this.mItems = new List <GameObject>(dataOfClass.drops.Length);
                    for (int index = 0; index < dataOfClass.drops.Length; ++index)
                    {
                        if (dataOfClass.drops[index] != null)
                        {
                            GameObject gameObject = (GameObject)Object.Instantiate <GameObject>((M0)this.ItemTemplate);
                            gameObject.get_transform().SetParent(this.ItemParent, false);
                            DataSource.Bind <ItemData>(gameObject, dataOfClass.drops[index]);
                            this.mItems.Add(gameObject);
                        }
                    }
                }
                ((Component)this).get_gameObject().SetActive(true);
                GameParameter.UpdateAll(((Component)this).get_gameObject());
                this.StartCoroutine(this.TreasureAnimation());
            }
        }
示例#2
0
        private ItemData[] MergeDropItems(RaidResult raidResult)
        {
            if (raidResult == null)
            {
                return(new ItemData[0]);
            }
            PlayerData      player       = MonoSingleton <GameManager> .Instance.Player;
            List <ItemData> itemDataList = new List <ItemData>();

            using (List <RaidQuestResult> .Enumerator enumerator = raidResult.results.GetEnumerator())
            {
                while (enumerator.MoveNext())
                {
                    RaidQuestResult current = enumerator.Current;
                    if (current != null)
                    {
                        foreach (ItemData drop in current.drops)
                        {
                            if (drop != null)
                            {
                                bool flag = false;
                                for (int index = 0; index < itemDataList.Count; ++index)
                                {
                                    if (itemDataList[index].Param == drop.Param)
                                    {
                                        itemDataList[index].Gain(drop.Num);
                                        flag = true;
                                        break;
                                    }
                                }
                                if (!flag)
                                {
                                    ItemData itemData = new ItemData();
                                    itemData.Setup(drop.UniqueID, drop.Param, drop.Num);
                                    ItemData itemDataByItemParam = player.FindItemDataByItemParam(itemData.Param);
                                    itemData.IsNew = !player.ItemEntryExists(itemData.Param.iname) || (itemDataByItemParam == null || itemDataByItemParam.IsNew);
                                    itemDataList.Add(itemData);
                                }
                            }
                        }
                    }
                }
            }
            return(itemDataList.ToArray());
        }
示例#3
0
        private QuestResult.DropItemData[] MergeDropItems(RaidResult raidResult)
        {
            if (raidResult == null)
            {
                return(new QuestResult.DropItemData[0]);
            }
            PlayerData player = MonoSingleton <GameManager> .Instance.Player;
            List <QuestResult.DropItemData> dropItemDataList = new List <QuestResult.DropItemData>();

            using (List <RaidQuestResult> .Enumerator enumerator = raidResult.results.GetEnumerator())
            {
                while (enumerator.MoveNext())
                {
                    RaidQuestResult current = enumerator.Current;
                    if (current != null)
                    {
                        foreach (QuestResult.DropItemData drop in current.drops)
                        {
                            if (drop != null)
                            {
                                bool flag = false;
                                for (int index = 0; index < dropItemDataList.Count; ++index)
                                {
                                    if (dropItemDataList[index].IsItem && drop.IsItem && dropItemDataList[index].itemParam == drop.itemParam)
                                    {
                                        dropItemDataList[index].Gain(drop.Num);
                                        flag = true;
                                        break;
                                    }
                                    if (dropItemDataList[index].IsConceptCard && drop.IsConceptCard && dropItemDataList[index].conceptCardParam == drop.conceptCardParam)
                                    {
                                        dropItemDataList[index].Gain(drop.Num);
                                        flag = true;
                                        break;
                                    }
                                }
                                if (!flag)
                                {
                                    QuestResult.DropItemData dropItemData = new QuestResult.DropItemData();
                                    if (drop.IsItem)
                                    {
                                        dropItemData.SetupDropItemData(EBattleRewardType.Item, 0L, drop.itemParam.iname, drop.Num);
                                        if (drop.itemParam.type != EItemType.Unit)
                                        {
                                            ItemData itemDataByItemParam = player.FindItemDataByItemParam(drop.itemParam);
                                            dropItemData.IsNew = !player.ItemEntryExists(drop.itemParam.iname) || (itemDataByItemParam == null || itemDataByItemParam.IsNew);
                                        }
                                        else
                                        {
                                            string iid = drop.itemParam.iname;
                                            if (player.Units.Find((Predicate <UnitData>)(p => p.UnitParam.iname == iid)) == null)
                                            {
                                                dropItemData.IsNew = true;
                                            }
                                        }
                                    }
                                    else if (drop.IsConceptCard)
                                    {
                                        dropItemData.SetupDropItemData(EBattleRewardType.ConceptCard, 0L, drop.conceptCardParam.iname, drop.Num);
                                    }
                                    dropItemDataList.Add(dropItemData);
                                }
                            }
                        }
                    }
                }
            }
            return(dropItemDataList.ToArray());
        }