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; } } } }
public void SetData(VersusTowerRewardItem.REWARD_TYPE type, int idx = 0) { GameManager instance = MonoSingleton <GameManager> .Instance; VersusTowerParam dataOfClass = DataSource.FindDataOfClass <VersusTowerParam>(((Component)this).get_gameObject(), (VersusTowerParam)null); int versusTowerFloor = instance.Player.VersusTowerFloor; if (dataOfClass == null) { return; } VERSUS_ITEM_TYPE versusItemType = VERSUS_ITEM_TYPE.item; string str = string.Empty; int num = 0; if (type == VersusTowerRewardItem.REWARD_TYPE.Arrival) { versusItemType = dataOfClass.ArrivalItemType; str = (string)dataOfClass.ArrivalIteminame; num = (int)dataOfClass.ArrivalItemNum; } else if (idx >= 0 && idx < dataOfClass.SeasonIteminame.Length) { versusItemType = dataOfClass.SeasonItemType[idx]; str = (string)dataOfClass.SeasonIteminame[idx]; num = (int)dataOfClass.SeasonItemnum[idx]; } if (Object.op_Inequality((Object)this.itemObj, (Object)null)) { this.itemObj.SetActive(true); } if (Object.op_Inequality((Object)this.amountObj, (Object)null)) { this.amountObj.SetActive(true); } if (Object.op_Inequality((Object)this.unitObj, (Object)null)) { this.unitObj.SetActive(false); } switch (versusItemType) { case VERSUS_ITEM_TYPE.item: if (Object.op_Inequality((Object)this.itemObj, (Object)null) && Object.op_Inequality((Object)this.amountObj, (Object)null)) { ArtifactIcon componentInChildren = (ArtifactIcon)this.itemObj.GetComponentInChildren <ArtifactIcon>(); if (Object.op_Inequality((Object)componentInChildren, (Object)null)) { ((Behaviour)componentInChildren).set_enabled(false); } this.itemObj.SetActive(true); DataSource component1 = (DataSource)this.itemObj.GetComponent <DataSource>(); if (Object.op_Inequality((Object)component1, (Object)null)) { component1.Clear(); } DataSource component2 = (DataSource)this.amountObj.GetComponent <DataSource>(); if (Object.op_Inequality((Object)component2, (Object)null)) { component2.Clear(); } ItemParam itemParam = instance.GetItemParam(str); DataSource.Bind <ItemParam>(this.itemObj, itemParam); ItemData data = new ItemData(); data.Setup(0L, itemParam, num); DataSource.Bind <ItemData>(this.amountObj, data); Transform child = this.itemObj.get_transform().FindChild("icon"); if (Object.op_Inequality((Object)child, (Object)null)) { GameParameter component3 = (GameParameter)((Component)child).GetComponent <GameParameter>(); if (Object.op_Inequality((Object)component3, (Object)null)) { ((Behaviour)component3).set_enabled(true); } } GameParameter.UpdateAll(this.itemObj); if (Object.op_Inequality((Object)this.iconParam, (Object)null)) { this.iconParam.UpdateValue(); } if (Object.op_Inequality((Object)this.frameParam, (Object)null)) { this.frameParam.UpdateValue(); } if (Object.op_Inequality((Object)this.rewardName, (Object)null)) { this.rewardName.set_text(itemParam.name + string.Format(LocalizedText.Get("sys.CROSS_NUM"), (object)num)); break; } break; } break; case VERSUS_ITEM_TYPE.gold: if (Object.op_Inequality((Object)this.itemTex, (Object)null)) { GameParameter component = (GameParameter)((Component)this.itemTex).GetComponent <GameParameter>(); if (Object.op_Inequality((Object)component, (Object)null)) { ((Behaviour)component).set_enabled(false); } this.itemTex.set_texture(this.goldTex); } if (Object.op_Inequality((Object)this.frameTex, (Object)null) && Object.op_Inequality((Object)this.goldBase, (Object)null)) { this.frameTex.set_sprite(this.goldBase); } if (Object.op_Inequality((Object)this.rewardName, (Object)null)) { this.rewardName.set_text(num.ToString() + LocalizedText.Get("sys.GOLD")); } if (Object.op_Inequality((Object)this.amountObj, (Object)null)) { this.amountObj.SetActive(false); break; } break; case VERSUS_ITEM_TYPE.coin: if (Object.op_Inequality((Object)this.itemTex, (Object)null)) { GameParameter component = (GameParameter)((Component)this.itemTex).GetComponent <GameParameter>(); if (Object.op_Inequality((Object)component, (Object)null)) { ((Behaviour)component).set_enabled(false); } this.itemTex.set_texture(this.coinTex); } if (Object.op_Inequality((Object)this.frameTex, (Object)null) && Object.op_Inequality((Object)this.coinBase, (Object)null)) { this.frameTex.set_sprite(this.coinBase); } if (Object.op_Inequality((Object)this.rewardName, (Object)null)) { this.rewardName.set_text(string.Format(LocalizedText.Get("sys.CHALLENGE_REWARD_COIN"), (object)num)); } if (Object.op_Inequality((Object)this.amountObj, (Object)null)) { this.amountObj.SetActive(false); break; } break; case VERSUS_ITEM_TYPE.unit: if (Object.op_Inequality((Object)this.unitObj, (Object)null)) { if (Object.op_Inequality((Object)this.itemObj, (Object)null)) { this.itemObj.SetActive(false); } this.unitObj.SetActive(true); UnitParam unitParam = instance.GetUnitParam(str); DebugUtility.Assert(unitParam != null, "Invalid unit:" + str); UnitData data = new UnitData(); data.Setup(str, 0, 1, 0, (string)null, 1, EElement.None, 0); DataSource.Bind <UnitData>(this.unitObj, data); GameParameter.UpdateAll(this.unitObj); if (Object.op_Inequality((Object)this.rewardName, (Object)null)) { this.rewardName.set_text(string.Format(LocalizedText.Get("sys.MULTI_VERSUS_REWARD_UNIT"), (object)unitParam.name)); break; } break; } break; case VERSUS_ITEM_TYPE.artifact: if (Object.op_Inequality((Object)this.itemObj, (Object)null)) { DataSource component = (DataSource)this.itemObj.GetComponent <DataSource>(); if (Object.op_Inequality((Object)component, (Object)null)) { component.Clear(); } ArtifactParam artifactParam = instance.MasterParam.GetArtifactParam(str); DataSource.Bind <ArtifactParam>(this.itemObj, artifactParam); ArtifactIcon componentInChildren = (ArtifactIcon)this.itemObj.GetComponentInChildren <ArtifactIcon>(); if (Object.op_Inequality((Object)componentInChildren, (Object)null)) { ((Behaviour)componentInChildren).set_enabled(true); componentInChildren.UpdateValue(); if (Object.op_Inequality((Object)this.rewardName, (Object)null)) { this.rewardName.set_text(string.Format(LocalizedText.Get("sys.MULTI_VERSUS_REWARD_ARTIFACT"), (object)artifactParam.name)); } if (Object.op_Inequality((Object)this.amountObj, (Object)null)) { this.amountObj.SetActive(false); break; } break; } break; } break; case VERSUS_ITEM_TYPE.award: if (Object.op_Inequality((Object)this.itemObj, (Object)null) && Object.op_Inequality((Object)this.amountObj, (Object)null)) { ArtifactIcon componentInChildren = (ArtifactIcon)this.itemObj.GetComponentInChildren <ArtifactIcon>(); if (Object.op_Inequality((Object)componentInChildren, (Object)null)) { ((Behaviour)componentInChildren).set_enabled(false); } this.itemObj.SetActive(true); AwardParam awardParam = instance.GetAwardParam(str); Transform child = this.itemObj.get_transform().FindChild("icon"); if (Object.op_Inequality((Object)child, (Object)null)) { IconLoader iconLoader = GameUtility.RequireComponent <IconLoader>(((Component)child).get_gameObject()); if (!string.IsNullOrEmpty(awardParam.icon)) { iconLoader.ResourcePath = AssetPath.ItemIcon(awardParam.icon); } GameParameter component = (GameParameter)((Component)child).GetComponent <GameParameter>(); if (Object.op_Inequality((Object)component, (Object)null)) { ((Behaviour)component).set_enabled(false); } } if (Object.op_Inequality((Object)this.frameTex, (Object)null) && Object.op_Inequality((Object)this.coinBase, (Object)null)) { this.frameTex.set_sprite(this.coinBase); } if (Object.op_Inequality((Object)this.amountObj, (Object)null)) { this.amountObj.SetActive(false); break; } break; } break; } this.mType = type; this.mSeasonIdx = idx; if (type == VersusTowerRewardItem.REWARD_TYPE.Arrival) { if (Object.op_Inequality((Object)this.currentMark, (Object)null)) { this.currentMark.SetActive((int)dataOfClass.Floor - 1 == versusTowerFloor); } if (Object.op_Inequality((Object)this.current_fil, (Object)null)) { this.current_fil.SetActive((int)dataOfClass.Floor - 1 == versusTowerFloor); } } else { if (Object.op_Inequality((Object)this.currentMark, (Object)null)) { this.currentMark.SetActive((int)dataOfClass.Floor == versusTowerFloor); } if (Object.op_Inequality((Object)this.current_fil, (Object)null)) { this.current_fil.SetActive((int)dataOfClass.Floor == versusTowerFloor); } } if (Object.op_Inequality((Object)this.clearMark, (Object)null)) { this.clearMark.SetActive((int)dataOfClass.Floor - 1 < versusTowerFloor); } if (!Object.op_Inequality((Object)this.cleared_fil, (Object)null)) { return; } this.cleared_fil.SetActive((int)dataOfClass.Floor - 1 < versusTowerFloor); }
public void SetData(int idx = 0) { GameManager instance = MonoSingleton <GameManager> .Instance; MultiTowerFloorParam dataOfClass = DataSource.FindDataOfClass <MultiTowerFloorParam>(((Component)this).get_gameObject(), (MultiTowerFloorParam)null); int floor = (int)dataOfClass.floor; if (dataOfClass == null) { return; } int mtRound = MonoSingleton <GameManager> .Instance.GetMTRound(GlobalVars.SelectedMultiTowerFloor); List <MultiTowerRewardItem> mtFloorReward = instance.GetMTFloorReward(dataOfClass.reward_id, mtRound); MultiTowerRewardItem multiTowerRewardItem = mtFloorReward[idx]; MultiTowerRewardItem.RewardType rewardType = MultiTowerRewardItem.RewardType.Item; string str = string.Empty; int num = 0; if (idx >= 0 && idx < mtFloorReward.Count) { rewardType = multiTowerRewardItem.type; str = multiTowerRewardItem.itemname; num = multiTowerRewardItem.num; } if (Object.op_Inequality((Object)this.itemObj, (Object)null)) { this.itemObj.SetActive(true); } if (Object.op_Inequality((Object)this.amountObj, (Object)null)) { this.amountObj.SetActive(true); } if (Object.op_Inequality((Object)this.unitObj, (Object)null)) { this.unitObj.SetActive(false); } switch (rewardType) { case MultiTowerRewardItem.RewardType.Item: if (Object.op_Inequality((Object)this.itemObj, (Object)null) && Object.op_Inequality((Object)this.amountObj, (Object)null)) { ArtifactIcon componentInChildren = (ArtifactIcon)this.itemObj.GetComponentInChildren <ArtifactIcon>(); if (Object.op_Inequality((Object)componentInChildren, (Object)null)) { ((Behaviour)componentInChildren).set_enabled(false); } this.itemObj.SetActive(true); DataSource component1 = (DataSource)this.itemObj.GetComponent <DataSource>(); if (Object.op_Inequality((Object)component1, (Object)null)) { component1.Clear(); } DataSource component2 = (DataSource)this.amountObj.GetComponent <DataSource>(); if (Object.op_Inequality((Object)component2, (Object)null)) { component2.Clear(); } ItemParam itemParam = instance.GetItemParam(str); DataSource.Bind <ItemParam>(this.itemObj, itemParam); ItemData data = new ItemData(); data.Setup(0L, itemParam, num); DataSource.Bind <ItemData>(this.amountObj, data); Transform child = this.itemObj.get_transform().FindChild("icon"); if (Object.op_Inequality((Object)child, (Object)null)) { GameParameter component3 = (GameParameter)((Component)child).GetComponent <GameParameter>(); if (Object.op_Inequality((Object)component3, (Object)null)) { ((Behaviour)component3).set_enabled(true); } } GameParameter.UpdateAll(this.itemObj); if (Object.op_Inequality((Object)this.iconParam, (Object)null)) { this.iconParam.UpdateValue(); } if (Object.op_Inequality((Object)this.frameParam, (Object)null)) { this.frameParam.UpdateValue(); } if (Object.op_Inequality((Object)this.rewardName, (Object)null)) { this.rewardName.set_text(itemParam.name + string.Format(LocalizedText.Get("sys.CROSS_NUM"), (object)num)); break; } break; } break; case MultiTowerRewardItem.RewardType.Coin: if (Object.op_Inequality((Object)this.itemTex, (Object)null)) { GameParameter component = (GameParameter)((Component)this.itemTex).GetComponent <GameParameter>(); if (Object.op_Inequality((Object)component, (Object)null)) { ((Behaviour)component).set_enabled(false); } this.itemTex.set_texture(this.coinTex); } if (Object.op_Inequality((Object)this.frameTex, (Object)null) && Object.op_Inequality((Object)this.coinBase, (Object)null)) { this.frameTex.set_sprite(this.coinBase); } if (Object.op_Inequality((Object)this.rewardName, (Object)null)) { this.rewardName.set_text(string.Format(LocalizedText.Get("sys.CHALLENGE_REWARD_COIN"), (object)num)); } if (Object.op_Inequality((Object)this.amountObj, (Object)null)) { this.amountObj.SetActive(false); break; } break; case MultiTowerRewardItem.RewardType.Artifact: if (Object.op_Inequality((Object)this.itemObj, (Object)null)) { DataSource component = (DataSource)this.itemObj.GetComponent <DataSource>(); if (Object.op_Inequality((Object)component, (Object)null)) { component.Clear(); } ArtifactParam artifactParam = instance.MasterParam.GetArtifactParam(str); DataSource.Bind <ArtifactParam>(this.itemObj, artifactParam); ArtifactIcon componentInChildren = (ArtifactIcon)this.itemObj.GetComponentInChildren <ArtifactIcon>(); if (Object.op_Inequality((Object)componentInChildren, (Object)null)) { ((Behaviour)componentInChildren).set_enabled(true); componentInChildren.UpdateValue(); if (Object.op_Inequality((Object)this.rewardName, (Object)null)) { this.rewardName.set_text(string.Format(LocalizedText.Get("sys.MULTI_VERSUS_REWARD_ARTIFACT"), (object)artifactParam.name)); } if (Object.op_Inequality((Object)this.amountObj, (Object)null)) { this.amountObj.SetActive(false); break; } break; } break; } break; case MultiTowerRewardItem.RewardType.Award: if (Object.op_Inequality((Object)this.itemObj, (Object)null) && Object.op_Inequality((Object)this.amountObj, (Object)null)) { ArtifactIcon componentInChildren = (ArtifactIcon)this.itemObj.GetComponentInChildren <ArtifactIcon>(); if (Object.op_Inequality((Object)componentInChildren, (Object)null)) { ((Behaviour)componentInChildren).set_enabled(false); } this.itemObj.SetActive(true); AwardParam awardParam = instance.GetAwardParam(str); Transform child = this.itemObj.get_transform().FindChild("icon"); if (Object.op_Inequality((Object)child, (Object)null)) { IconLoader iconLoader = GameUtility.RequireComponent <IconLoader>(((Component)child).get_gameObject()); if (!string.IsNullOrEmpty(awardParam.icon)) { iconLoader.ResourcePath = AssetPath.ItemIcon(awardParam.icon); } GameParameter component = (GameParameter)((Component)child).GetComponent <GameParameter>(); if (Object.op_Inequality((Object)component, (Object)null)) { ((Behaviour)component).set_enabled(false); } } if (Object.op_Inequality((Object)this.frameTex, (Object)null) && Object.op_Inequality((Object)this.coinBase, (Object)null)) { this.frameTex.set_sprite(this.coinBase); } if (Object.op_Inequality((Object)this.amountObj, (Object)null)) { this.amountObj.SetActive(false); break; } break; } break; case MultiTowerRewardItem.RewardType.Unit: if (Object.op_Inequality((Object)this.unitObj, (Object)null)) { if (Object.op_Inequality((Object)this.itemObj, (Object)null)) { this.itemObj.SetActive(false); } this.unitObj.SetActive(true); UnitParam unitParam = instance.GetUnitParam(str); DebugUtility.Assert(unitParam != null, "Invalid unit:" + str); UnitData data = new UnitData(); data.Setup(str, 0, 1, 0, (string)null, 1, EElement.None, 0); DataSource.Bind <UnitData>(this.unitObj, data); GameParameter.UpdateAll(this.unitObj); if (Object.op_Inequality((Object)this.rewardName, (Object)null)) { this.rewardName.set_text(string.Format(LocalizedText.Get("sys.MULTI_VERSUS_REWARD_UNIT"), (object)unitParam.name)); break; } break; } break; case MultiTowerRewardItem.RewardType.Gold: if (Object.op_Inequality((Object)this.itemTex, (Object)null)) { GameParameter component = (GameParameter)((Component)this.itemTex).GetComponent <GameParameter>(); if (Object.op_Inequality((Object)component, (Object)null)) { ((Behaviour)component).set_enabled(false); } this.itemTex.set_texture(this.goldTex); } if (Object.op_Inequality((Object)this.frameTex, (Object)null) && Object.op_Inequality((Object)this.goldBase, (Object)null)) { this.frameTex.set_sprite(this.goldBase); } if (Object.op_Inequality((Object)this.rewardName, (Object)null)) { this.rewardName.set_text(num.ToString() + LocalizedText.Get("sys.GOLD")); } if (Object.op_Inequality((Object)this.amountObj, (Object)null)) { this.amountObj.SetActive(false); break; } break; } this.mIdx = idx; if (Object.op_Inequality((Object)this.currentMark, (Object)null)) { this.currentMark.SetActive((int)dataOfClass.floor == floor); } if (Object.op_Inequality((Object)this.current_fil, (Object)null)) { this.current_fil.SetActive((int)dataOfClass.floor == floor); } if (Object.op_Inequality((Object)this.clearMark, (Object)null)) { this.clearMark.SetActive((int)dataOfClass.floor - 1 < floor); } if (!Object.op_Inequality((Object)this.cleared_fil, (Object)null)) { return; } this.cleared_fil.SetActive((int)dataOfClass.floor - 1 < floor); }
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; } } } }
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); }
private void SetData() { GameManager instance = MonoSingleton <GameManager> .Instance; MultiTowerRewardItem dataOfClass = DataSource.FindDataOfClass <MultiTowerRewardItem>(((Component)this).get_gameObject(), (MultiTowerRewardItem)null); if (dataOfClass == null) { if (Object.op_Inequality((Object)this.itemObj, (Object)null)) { this.itemObj.SetActive(false); } if (Object.op_Inequality((Object)this.amountObj, (Object)null)) { this.amountObj.SetActive(false); } if (Object.op_Inequality((Object)this.unitObj, (Object)null)) { this.unitObj.SetActive(false); } if (!Object.op_Inequality((Object)this.rewardName, (Object)null)) { return; } ((Component)this.rewardName).get_gameObject().SetActive(false); } else { MultiTowerRewardItem.RewardType type = dataOfClass.type; string itemname = dataOfClass.itemname; int num = dataOfClass.num; if (Object.op_Inequality((Object)this.itemObj, (Object)null)) { this.itemObj.SetActive(true); } if (Object.op_Inequality((Object)this.amountObj, (Object)null)) { this.amountObj.SetActive(true); } if (Object.op_Inequality((Object)this.unitObj, (Object)null)) { this.unitObj.SetActive(false); } if (Object.op_Inequality((Object)this.rewardName, (Object)null)) { ((Component)this.rewardName).get_gameObject().SetActive(true); } switch (type) { case MultiTowerRewardItem.RewardType.Item: if (Object.op_Inequality((Object)this.artifactObj, (Object)null)) { this.artifactObj.SetActive(false); } if (!Object.op_Inequality((Object)this.itemObj, (Object)null) || !Object.op_Inequality((Object)this.amountObj, (Object)null)) { break; } this.itemObj.SetActive(true); DataSource component1 = (DataSource)this.itemObj.GetComponent <DataSource>(); if (Object.op_Inequality((Object)component1, (Object)null)) { component1.Clear(); } DataSource component2 = (DataSource)this.amountObj.GetComponent <DataSource>(); if (Object.op_Inequality((Object)component2, (Object)null)) { component2.Clear(); } ItemParam itemParam = instance.GetItemParam(itemname); DataSource.Bind <ItemParam>(this.itemObj, itemParam); ItemData data1 = new ItemData(); data1.Setup(0L, itemParam, num); DataSource.Bind <ItemData>(this.amountObj, data1); Transform child1 = this.itemObj.get_transform().FindChild("icon"); if (Object.op_Inequality((Object)child1, (Object)null)) { GameParameter component3 = (GameParameter)((Component)child1).GetComponent <GameParameter>(); if (Object.op_Inequality((Object)component3, (Object)null)) { ((Behaviour)component3).set_enabled(true); } } GameParameter.UpdateAll(this.itemObj); if (Object.op_Inequality((Object)this.iconParam, (Object)null)) { this.iconParam.UpdateValue(); } if (Object.op_Inequality((Object)this.frameParam, (Object)null)) { this.frameParam.UpdateValue(); } if (Object.op_Inequality((Object)this.rewardName, (Object)null)) { this.rewardName.set_text(itemParam.name + string.Format(LocalizedText.Get("sys.CROSS_NUM"), (object)num)); } if (!Object.op_Inequality((Object)this.amountOther, (Object)null)) { break; } this.amountOther.SetActive(false); break; case MultiTowerRewardItem.RewardType.Coin: if (Object.op_Inequality((Object)this.artifactObj, (Object)null)) { this.artifactObj.SetActive(false); } if (Object.op_Inequality((Object)this.itemTex, (Object)null)) { GameParameter component3 = (GameParameter)((Component)this.itemTex).GetComponent <GameParameter>(); if (Object.op_Inequality((Object)component3, (Object)null)) { ((Behaviour)component3).set_enabled(false); } this.itemTex.set_texture(this.coinTex); } if (Object.op_Inequality((Object)this.frameTex, (Object)null) && Object.op_Inequality((Object)this.coinBase, (Object)null)) { this.frameTex.set_sprite(this.coinBase); } if (Object.op_Inequality((Object)this.rewardName, (Object)null)) { this.rewardName.set_text(string.Format(LocalizedText.Get("sys.CHALLENGE_REWARD_COIN"), (object)num)); } if (Object.op_Inequality((Object)this.amountObj, (Object)null)) { this.amountObj.SetActive(false); } if (!Object.op_Inequality((Object)this.amountOther, (Object)null)) { break; } if (this.amountDisp) { this.amountOther.SetActive(true); if (!Object.op_Inequality((Object)this.amountCount, (Object)null)) { break; } this.amountCount.set_text(dataOfClass.num.ToString()); break; } this.amountOther.SetActive(false); break; case MultiTowerRewardItem.RewardType.Artifact: if (Object.op_Inequality((Object)this.itemObj, (Object)null)) { this.itemObj.SetActive(false); } if (!Object.op_Inequality((Object)this.artifactObj, (Object)null)) { break; } this.artifactObj.SetActive(true); DataSource component4 = (DataSource)this.artifactObj.GetComponent <DataSource>(); if (Object.op_Inequality((Object)component4, (Object)null)) { component4.Clear(); } ArtifactParam artifactParam = instance.MasterParam.GetArtifactParam(itemname); DataSource.Bind <ArtifactParam>(this.artifactObj, artifactParam); ArtifactIcon componentInChildren = (ArtifactIcon)this.artifactObj.GetComponentInChildren <ArtifactIcon>(); if (!Object.op_Inequality((Object)componentInChildren, (Object)null)) { break; } ((Behaviour)componentInChildren).set_enabled(true); componentInChildren.UpdateValue(); if (Object.op_Inequality((Object)this.rewardName, (Object)null)) { this.rewardName.set_text(string.Format(LocalizedText.Get("sys.MULTI_VERSUS_REWARD_ARTIFACT"), (object)artifactParam.name)); } if (Object.op_Inequality((Object)this.amountObj, (Object)null)) { this.amountObj.SetActive(false); } if (!Object.op_Inequality((Object)this.Artifactamount, (Object)null)) { break; } this.Artifactamount.set_text(dataOfClass.num.ToString()); break; case MultiTowerRewardItem.RewardType.Award: if (Object.op_Inequality((Object)this.artifactObj, (Object)null)) { this.artifactObj.SetActive(false); } if (!Object.op_Inequality((Object)this.itemObj, (Object)null) || !Object.op_Inequality((Object)this.amountObj, (Object)null)) { break; } this.itemObj.SetActive(true); AwardParam awardParam = instance.GetAwardParam(itemname); Transform child2 = this.itemObj.get_transform().FindChild("icon"); if (Object.op_Inequality((Object)child2, (Object)null)) { IconLoader iconLoader = GameUtility.RequireComponent <IconLoader>(((Component)child2).get_gameObject()); if (!string.IsNullOrEmpty(awardParam.icon)) { iconLoader.ResourcePath = AssetPath.ItemIcon(awardParam.icon); } GameParameter component3 = (GameParameter)((Component)child2).GetComponent <GameParameter>(); if (Object.op_Inequality((Object)component3, (Object)null)) { ((Behaviour)component3).set_enabled(false); } if (Object.op_Inequality((Object)this.rewardName, (Object)null)) { this.rewardName.set_text(awardParam.name); } } if (Object.op_Inequality((Object)this.frameTex, (Object)null) && Object.op_Inequality((Object)this.coinBase, (Object)null)) { this.frameTex.set_sprite(this.coinBase); } if (Object.op_Inequality((Object)this.amountObj, (Object)null)) { this.amountObj.SetActive(false); } if (!Object.op_Inequality((Object)this.amountOther, (Object)null)) { break; } this.amountOther.SetActive(false); break; case MultiTowerRewardItem.RewardType.Unit: if (!Object.op_Inequality((Object)this.unitObj, (Object)null)) { break; } if (Object.op_Inequality((Object)this.itemObj, (Object)null)) { this.itemObj.SetActive(false); } if (Object.op_Inequality((Object)this.artifactObj, (Object)null)) { this.artifactObj.SetActive(false); } this.unitObj.SetActive(true); UnitParam unitParam = instance.GetUnitParam(itemname); DebugUtility.Assert(unitParam != null, "Invalid unit:" + itemname); UnitData data2 = new UnitData(); data2.Setup(itemname, 0, 1, 0, (string)null, 1, EElement.None, 0); DataSource.Bind <UnitData>(this.unitObj, data2); GameParameter.UpdateAll(this.unitObj); if (Object.op_Inequality((Object)this.rewardName, (Object)null)) { this.rewardName.set_text(string.Format(LocalizedText.Get("sys.MULTI_VERSUS_REWARD_UNIT"), (object)unitParam.name)); } if (!Object.op_Inequality((Object)this.amountOther, (Object)null)) { break; } this.amountOther.SetActive(false); break; case MultiTowerRewardItem.RewardType.Gold: if (Object.op_Inequality((Object)this.artifactObj, (Object)null)) { this.artifactObj.SetActive(false); } if (Object.op_Inequality((Object)this.itemTex, (Object)null)) { GameParameter component3 = (GameParameter)((Component)this.itemTex).GetComponent <GameParameter>(); if (Object.op_Inequality((Object)component3, (Object)null)) { ((Behaviour)component3).set_enabled(false); } this.itemTex.set_texture(this.goldTex); } if (Object.op_Inequality((Object)this.frameTex, (Object)null) && Object.op_Inequality((Object)this.goldBase, (Object)null)) { this.frameTex.set_sprite(this.goldBase); } if (Object.op_Inequality((Object)this.rewardName, (Object)null)) { this.rewardName.set_text(num.ToString() + LocalizedText.Get("sys.GOLD")); } if (Object.op_Inequality((Object)this.amountObj, (Object)null)) { this.amountObj.SetActive(false); } if (!Object.op_Inequality((Object)this.amountOther, (Object)null)) { break; } if (this.amountDisp) { this.amountOther.SetActive(true); if (!Object.op_Inequality((Object)this.amountCount, (Object)null)) { break; } this.amountCount.set_text(dataOfClass.num.ToString()); break; } this.amountOther.SetActive(false); break; } } }
public void SetData(VersusTowerRewardItem.REWARD_TYPE type, int idx = 0) { GameManager instance = MonoSingleton <GameManager> .Instance; VersusTowerParam dataOfClass = DataSource.FindDataOfClass <VersusTowerParam>(((Component)this).get_gameObject(), (VersusTowerParam)null); if (dataOfClass == null) { return; } VERSUS_ITEM_TYPE versusItemType = VERSUS_ITEM_TYPE.item; string str = string.Empty; int num = 0; if (type == VersusTowerRewardItem.REWARD_TYPE.Arrival) { versusItemType = dataOfClass.ArrivalItemType; str = (string)dataOfClass.ArrivalIteminame; num = (int)dataOfClass.ArrivalItemNum; } else if (idx >= 0 && idx < dataOfClass.SeasonIteminame.Length) { versusItemType = dataOfClass.SeasonItemType[idx]; str = (string)dataOfClass.SeasonIteminame[idx]; num = (int)dataOfClass.SeasonItemnum[idx]; } if (Object.op_Inequality((Object)this.itemObj, (Object)null)) { this.itemObj.SetActive(true); } if (Object.op_Inequality((Object)this.unitObj, (Object)null)) { this.unitObj.SetActive(false); } switch (versusItemType) { case VERSUS_ITEM_TYPE.item: if (!Object.op_Inequality((Object)this.itemObj, (Object)null) || !Object.op_Inequality((Object)this.amountObj, (Object)null)) { break; } ArtifactIcon componentInChildren1 = (ArtifactIcon)this.itemObj.GetComponentInChildren <ArtifactIcon>(); if (Object.op_Inequality((Object)componentInChildren1, (Object)null)) { ((Behaviour)componentInChildren1).set_enabled(false); } this.itemObj.SetActive(true); ItemParam itemParam = instance.GetItemParam(str); DataSource.Bind <ItemParam>(this.itemObj, itemParam); ItemData data1 = new ItemData(); data1.Setup(0L, itemParam, num); DataSource.Bind <ItemData>(this.amountObj, data1); GameParameter.UpdateAll(this.itemObj); if (Object.op_Inequality((Object)this.iconParam, (Object)null)) { this.iconParam.UpdateValue(); } if (Object.op_Inequality((Object)this.frameParam, (Object)null)) { this.frameParam.UpdateValue(); } if (!Object.op_Inequality((Object)this.rewardName, (Object)null)) { break; } this.rewardName.set_text(itemParam.name + string.Format(LocalizedText.Get("sys.CROSS_NUM"), (object)num)); break; case VERSUS_ITEM_TYPE.gold: if (Object.op_Inequality((Object)this.itemTex, (Object)null)) { GameParameter component = (GameParameter)((Component)this.itemTex).GetComponent <GameParameter>(); if (Object.op_Inequality((Object)component, (Object)null)) { ((Behaviour)component).set_enabled(false); } this.itemTex.set_texture(this.goldTex); } if (Object.op_Inequality((Object)this.frameTex, (Object)null) && Object.op_Inequality((Object)this.goldBase, (Object)null)) { this.frameTex.set_sprite(this.goldBase); } if (Object.op_Inequality((Object)this.rewardName, (Object)null)) { this.rewardName.set_text(num.ToString() + LocalizedText.Get("sys.GOLD")); } if (!Object.op_Inequality((Object)this.amountObj, (Object)null)) { break; } this.amountObj.SetActive(false); break; case VERSUS_ITEM_TYPE.coin: if (Object.op_Inequality((Object)this.itemTex, (Object)null)) { GameParameter component = (GameParameter)((Component)this.itemTex).GetComponent <GameParameter>(); if (Object.op_Inequality((Object)component, (Object)null)) { ((Behaviour)component).set_enabled(false); } this.itemTex.set_texture(this.coinTex); } if (Object.op_Inequality((Object)this.frameTex, (Object)null) && Object.op_Inequality((Object)this.coinBase, (Object)null)) { this.frameTex.set_sprite(this.coinBase); } if (Object.op_Inequality((Object)this.rewardName, (Object)null)) { this.rewardName.set_text(string.Format(LocalizedText.Get("sys.CHALLENGE_REWARD_COIN"), (object)num)); } if (!Object.op_Inequality((Object)this.amountObj, (Object)null)) { break; } this.amountObj.SetActive(false); break; case VERSUS_ITEM_TYPE.unit: if (!Object.op_Inequality((Object)this.unitObj, (Object)null)) { break; } if (Object.op_Inequality((Object)this.itemObj, (Object)null)) { this.itemObj.SetActive(false); } this.unitObj.SetActive(true); UnitParam unitParam = instance.GetUnitParam(str); DebugUtility.Assert(unitParam != null, "Invalid unit:" + str); UnitData data2 = new UnitData(); data2.Setup(str, 0, 1, 0, (string)null, 1, EElement.None); DataSource.Bind <UnitData>(this.unitObj, data2); GameParameter.UpdateAll(this.unitObj); if (!Object.op_Inequality((Object)this.rewardName, (Object)null)) { break; } this.rewardName.set_text(unitParam.name); break; case VERSUS_ITEM_TYPE.artifact: if (!Object.op_Inequality((Object)this.itemObj, (Object)null)) { break; } ArtifactParam artifactParam = instance.MasterParam.GetArtifactParam(str); DataSource.Bind <ArtifactParam>(this.itemObj, artifactParam); ArtifactIcon componentInChildren2 = (ArtifactIcon)this.itemObj.GetComponentInChildren <ArtifactIcon>(); if (!Object.op_Inequality((Object)componentInChildren2, (Object)null)) { break; } ((Behaviour)componentInChildren2).set_enabled(true); componentInChildren2.UpdateValue(); if (Object.op_Inequality((Object)this.rewardName, (Object)null)) { this.rewardName.set_text(artifactParam.name); } if (!Object.op_Inequality((Object)this.amountObj, (Object)null)) { break; } this.amountObj.SetActive(false); break; } }