コード例 #1
0
        protected override void Refresh()
        {
            if (UnityEngine.Object.op_Equality((UnityEngine.Object) this.ItemTemplate, (UnityEngine.Object)null))
            {
                return;
            }
            for (int index = this.mItems.Count - 1; index >= 0; --index)
            {
                UnityEngine.Object.Destroy((UnityEngine.Object) this.mItems[index]);
            }
            QuestParam dataOfClass = DataSource.FindDataOfClass <QuestParam>(((Component)this).get_gameObject(), (QuestParam)null);

            if (dataOfClass == null)
            {
                return;
            }
            Transform transform = ((Component)this).get_transform();
            List <TowerRewardItem> towerRewardItem = MonoSingleton <GameManager> .Instance.FindTowerReward(MonoSingleton <GameManager> .Instance.FindTowerFloor(dataOfClass.iname).reward_id).GetTowerRewardItem();

            for (int index = 0; index < towerRewardItem.Count; ++index)
            {
                TowerRewardItem item = towerRewardItem[index];
                if (item.visible && item.type != TowerRewardItem.RewardType.Gold)
                {
                    GameObject gameObject = (GameObject)UnityEngine.Object.Instantiate <GameObject>((M0)this.ItemTemplate);
                    gameObject.get_transform().SetParent(transform, false);
                    gameObject.get_transform().set_localScale(this.ItemTemplate.get_transform().get_localScale());
                    DataSource.Bind <TowerRewardItem>(gameObject, item);
                    gameObject.SetActive(true);
                    foreach (GameParameter componentsInChild in (GameParameter[])gameObject.GetComponentsInChildren <GameParameter>())
                    {
                        componentsInChild.Index = index;
                    }
                    TowerRewardUI componentInChildren1 = (TowerRewardUI)gameObject.GetComponentInChildren <TowerRewardUI>();
                    if (UnityEngine.Object.op_Inequality((UnityEngine.Object)componentInChildren1, (UnityEngine.Object)null))
                    {
                        componentInChildren1.Refresh();
                    }
                    if (item.type == TowerRewardItem.RewardType.Artifact)
                    {
                        ArtifactParam artifactParam = MonoSingleton <GameManager> .Instance.MasterParam.GetArtifactParam(item.iname);

                        DataSource.Bind <ArtifactParam>(gameObject, artifactParam);
                        ArtifactIcon componentInChildren2 = (ArtifactIcon)gameObject.GetComponentInChildren <ArtifactIcon>();
                        if (UnityEngine.Object.op_Equality((UnityEngine.Object)componentInChildren2, (UnityEngine.Object)null))
                        {
                            break;
                        }
                        ((Behaviour)componentInChildren2).set_enabled(true);
                        componentInChildren2.UpdateValue();
                        if (MonoSingleton <GameManager> .Instance.Player.Artifacts.Find((Predicate <ArtifactData>)(x => x.ArtifactParam.iname == item.iname)) != null)
                        {
                            break;
                        }
                        item.is_new = true;
                        break;
                    }
                }
            }
        }
コード例 #2
0
        protected override void Refresh()
        {
            if (UnityEngine.Object.op_Equality((UnityEngine.Object) this.ItemTemplate, (UnityEngine.Object)null))
            {
                return;
            }
            for (int index = this.mItems.Count - 1; index >= 0; --index)
            {
                UnityEngine.Object.Destroy((UnityEngine.Object) this.mItems[index]);
            }
            QuestParam dataOfClass = DataSource.FindDataOfClass <QuestParam>(((Component)this).get_gameObject(), (QuestParam)null);

            if (dataOfClass == null)
            {
                return;
            }
            Transform transform = ((Component)this).get_transform();
            List <TowerRewardItem> towerRewardItem = MonoSingleton <GameManager> .Instance.FindTowerReward(MonoSingleton <GameManager> .Instance.FindTowerFloor(dataOfClass.iname).reward_id).GetTowerRewardItem();

            for (int index = 0; index < towerRewardItem.Count; ++index)
            {
                // ISSUE: object of a compiler-generated type is created
                // ISSUE: variable of a compiler-generated type
                TowerQuestDropItemList.\u003CRefresh\u003Ec__AnonStorey37F refreshCAnonStorey37F = new TowerQuestDropItemList.\u003CRefresh\u003Ec__AnonStorey37F();
                // ISSUE: reference to a compiler-generated field
                refreshCAnonStorey37F.item = towerRewardItem[index];
                // ISSUE: reference to a compiler-generated field
                // ISSUE: reference to a compiler-generated field
                if (refreshCAnonStorey37F.item.visible && refreshCAnonStorey37F.item.type != TowerRewardItem.RewardType.Gold)
                {
                    GameObject gameObject = (GameObject)UnityEngine.Object.Instantiate <GameObject>((M0)this.ItemTemplate);
                    gameObject.get_transform().SetParent(transform, false);
                    gameObject.get_transform().set_localScale(this.ItemTemplate.get_transform().get_localScale());
                    // ISSUE: reference to a compiler-generated field
                    DataSource.Bind <TowerRewardItem>(gameObject, refreshCAnonStorey37F.item);
                    gameObject.SetActive(true);
                    foreach (GameParameter componentsInChild in (GameParameter[])gameObject.GetComponentsInChildren <GameParameter>())
                    {
                        componentsInChild.Index = index;
                    }
                    TowerRewardUI componentInChildren1 = (TowerRewardUI)gameObject.GetComponentInChildren <TowerRewardUI>();
                    if (UnityEngine.Object.op_Inequality((UnityEngine.Object)componentInChildren1, (UnityEngine.Object)null))
                    {
                        componentInChildren1.Refresh();
                    }
                    // ISSUE: reference to a compiler-generated field
                    if (refreshCAnonStorey37F.item.type == TowerRewardItem.RewardType.Artifact)
                    {
                        // ISSUE: reference to a compiler-generated field
                        ArtifactParam artifactParam = MonoSingleton <GameManager> .Instance.MasterParam.GetArtifactParam(refreshCAnonStorey37F.item.iname);

                        DataSource.Bind <ArtifactParam>(gameObject, artifactParam);
                        ArtifactIcon componentInChildren2 = (ArtifactIcon)gameObject.GetComponentInChildren <ArtifactIcon>();
                        if (UnityEngine.Object.op_Equality((UnityEngine.Object)componentInChildren2, (UnityEngine.Object)null))
                        {
                            break;
                        }
                        ((Behaviour)componentInChildren2).set_enabled(true);
                        componentInChildren2.UpdateValue();
                        // ISSUE: reference to a compiler-generated method
                        if (MonoSingleton <GameManager> .Instance.Player.Artifacts.Find(new Predicate <ArtifactData>(refreshCAnonStorey37F.\u003C\u003Em__424)) != null)
                        {
                            break;
                        }
                        // ISSUE: reference to a compiler-generated field
                        refreshCAnonStorey37F.item.is_new = true;
                        break;
                    }
                }
            }
        }
コード例 #3
0
        private void SetTowerResult(Transform parent, GameObject ItemObject, List <ItemData> data = null)
        {
            if (this.mCurrentQuest.type != QuestTypes.Tower)
            {
                return;
            }
            List <TowerRewardItem> towerRewardItemList = new List <TowerRewardItem>((IEnumerable <TowerRewardItem>)MonoSingleton <GameManager> .Instance.FindTowerReward(MonoSingleton <GameManager> .Instance.FindTowerFloor(GlobalVars.SelectedQuestID).reward_id).GetTowerRewardItem());

            if (data != null)
            {
                for (int index = 0; index < data.Count; ++index)
                {
                    ItemData itemData = data[index];
                    if (itemData != null)
                    {
                        towerRewardItemList.Add(new TowerRewardItem()
                        {
                            iname   = itemData.Param.iname,
                            type    = TowerRewardItem.RewardType.Item,
                            num     = data[index].Num,
                            visible = true,
                            is_new  = data[index].IsNew
                        });
                    }
                }
            }
            for (int index = 0; index < towerRewardItemList.Count; ++index)
            {
                // ISSUE: object of a compiler-generated type is created
                // ISSUE: variable of a compiler-generated type
                TowerQuestResult.\u003CSetTowerResult\u003Ec__AnonStorey275 resultCAnonStorey275 = new TowerQuestResult.\u003CSetTowerResult\u003Ec__AnonStorey275();
                // ISSUE: reference to a compiler-generated field
                resultCAnonStorey275.item = towerRewardItemList[index];
                // ISSUE: reference to a compiler-generated field
                // ISSUE: reference to a compiler-generated field
                if (resultCAnonStorey275.item.visible && resultCAnonStorey275.item.type != TowerRewardItem.RewardType.Gold)
                {
                    GameObject gameObject = (GameObject)Object.Instantiate <GameObject>((M0)ItemObject);
                    gameObject.get_transform().SetParent(parent, false);
                    this.mTowerListItems.Add(gameObject);
                    gameObject.get_transform().set_localScale(ItemObject.get_transform().get_localScale());
                    DataSource.Bind <TowerRewardItem>(gameObject, towerRewardItemList[index]);
                    gameObject.SetActive(true);
                    foreach (GameParameter componentsInChild in (GameParameter[])gameObject.GetComponentsInChildren <GameParameter>())
                    {
                        componentsInChild.Index = index;
                    }
                    TowerRewardUI componentInChildren1 = (TowerRewardUI)gameObject.GetComponentInChildren <TowerRewardUI>();
                    if (Object.op_Inequality((Object)componentInChildren1, (Object)null))
                    {
                        componentInChildren1.Refresh();
                    }
                    // ISSUE: reference to a compiler-generated field
                    if (resultCAnonStorey275.item.type == TowerRewardItem.RewardType.Artifact)
                    {
                        // ISSUE: reference to a compiler-generated field
                        ArtifactParam artifactParam = MonoSingleton <GameManager> .Instance.MasterParam.GetArtifactParam(resultCAnonStorey275.item.iname);

                        DataSource.Bind <ArtifactParam>(gameObject, artifactParam);
                        ArtifactIcon componentInChildren2 = (ArtifactIcon)gameObject.GetComponentInChildren <ArtifactIcon>();
                        if (!Object.op_Equality((Object)componentInChildren2, (Object)null))
                        {
                            ((Behaviour)componentInChildren2).set_enabled(true);
                            componentInChildren2.UpdateValue();
                            // ISSUE: reference to a compiler-generated method
                            if (MonoSingleton <GameManager> .Instance.Player.Artifacts.Find(new Predicate <ArtifactData>(resultCAnonStorey275.\u003C\u003Em__2F6)) == null)
                            {
                                // ISSUE: reference to a compiler-generated field
                                resultCAnonStorey275.item.is_new = true;
                                break;
                            }
                            break;
                        }
                        break;
                    }
                    // ISSUE: reference to a compiler-generated field
                    if (Object.op_Inequality((Object)this.Prefab_NewItemBadge, (Object)null) && resultCAnonStorey275.item.is_new)
                    {
                        RectTransform transform = ((GameObject)Object.Instantiate <GameObject>((M0)this.Prefab_NewItemBadge)).get_transform() as RectTransform;
                        ((Component)transform).get_gameObject().SetActive(true);
                        transform.set_anchoredPosition(Vector2.get_zero());
                        ((Transform)transform).SetParent(gameObject.get_transform(), false);
                    }
                }
            }
            ItemObject.SetActive(false);
        }