public void Setup(SkillAbilityDeriveParam skillAbilityDeriveParam) { this.m_ViewContentSkillParams = SkillAbilityDeriveListItem.CreateViewContentSkillParams(skillAbilityDeriveParam.SkillDeriveParams); this.m_ViewContentAbilityParams = SkillAbilityDeriveListItem.CreateViewContentAbilityParams(skillAbilityDeriveParam.AbilityDeriveParams); using (List <SkillAbilityDeriveListItem.ViewContentSkillParam> .Enumerator enumerator = this.m_ViewContentSkillParams.GetEnumerator()) { while (enumerator.MoveNext()) { this.CreateListItem(enumerator.Current); } } using (List <SkillAbilityDeriveListItem.ViewContentAbilityParam> .Enumerator enumerator = this.m_ViewContentAbilityParams.GetEnumerator()) { while (enumerator.MoveNext()) { this.CreateListItem(enumerator.Current); } } this.UpdateUIActive(); }
public override void UpdateValue() { ArtifactData data = (ArtifactData)null; ArtifactParam artifactParam = (ArtifactParam)null; GameManager instance1 = MonoSingleton <GameManager> .Instance; if (this.InstanceType == ArtifactIcon.InstanceTypes.ArtifactData) { data = DataSource.FindDataOfClass <ArtifactData>(((Component)this).get_gameObject(), (ArtifactData)null); } else if (this.InstanceType == ArtifactIcon.InstanceTypes.SkillAbilityDeriveParam) { SkillAbilityDeriveParam dataOfClass = DataSource.FindDataOfClass <SkillAbilityDeriveParam>(((Component)this).get_gameObject(), (SkillAbilityDeriveParam)null); if (dataOfClass != null) { artifactParam = dataOfClass.GetTriggerArtifactParam(this.DeriveTriggerIndex); } } else if (this.InstanceType == ArtifactIcon.InstanceTypes.ArtifactDataOrParam) { data = DataSource.FindDataOfClass <ArtifactData>(((Component)this).get_gameObject(), (ArtifactData)null); if (data == null) { artifactParam = DataSource.FindDataOfClass <ArtifactParam>(((Component)this).get_gameObject(), (ArtifactParam)null); } } else { artifactParam = DataSource.FindDataOfClass <ArtifactParam>(((Component)this).get_gameObject(), (ArtifactParam)null); } if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.Lv, (UnityEngine.Object)null)) { if (data != null) { if ((int)data.Lv != this.mLastLv) { this.mLastLv = (int)data.Lv; this.Lv.set_text(data.Lv.ToString()); } ((Component)this.Lv).get_gameObject().SetActive(true); } else { ((Component)this.Lv).get_gameObject().SetActive(false); } } if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.PreLvCap, (UnityEngine.Object)null)) { if (data != null && (int)data.Rarity > 0) { this.PreLvCap.set_text(MonoSingleton <GameManager> .Instance.GetRarityParam((int)data.Rarity - 1).ArtifactLvCap.ToString()); ((Component)this.PreLvCap).get_gameObject().SetActive(true); } else { ((Component)this.PreLvCap).get_gameObject().SetActive(false); } } if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.LvCap, (UnityEngine.Object)null)) { if (data != null) { if ((int)data.LvCap != this.mLastLvCap) { this.mLastLvCap = (int)data.LvCap; this.LvCap.set_text(data.LvCap.ToString()); } ((Component)this.LvCap).get_gameObject().SetActive(true); } else { ((Component)this.LvCap).get_gameObject().SetActive(false); } } if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.LvGauge, (UnityEngine.Object)null)) { if (data != null) { if (data.Exp != this.mLastExpNum) { this.LvGauge.set_minValue(1f); this.LvGauge.set_maxValue((float)(int)data.LvCap); this.LvGauge.set_value((float)(int)data.Lv); } ((Component)this.LvGauge).get_gameObject().SetActive(true); } else { ((Component)this.LvGauge).get_gameObject().SetActive(false); } } if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.ExpGauge, (UnityEngine.Object)null)) { if (data != null) { if (data.Exp != this.mLastExpNum) { if ((int)data.Lv >= (int)data.LvCap) { this.ExpGauge.set_minValue(0.0f); Slider expGauge = this.ExpGauge; float num1 = 1f; this.ExpGauge.set_value(num1); double num2 = (double)num1; expGauge.set_maxValue((float)num2); } else { int showExp = data.GetShowExp(); int nextExp = data.GetNextExp(); this.ExpGauge.set_minValue(0.0f); this.ExpGauge.set_maxValue((float)(showExp + nextExp)); this.ExpGauge.set_value((float)showExp); } } ((Component)this.ExpGauge).get_gameObject().SetActive(true); } else { ((Component)this.ExpGauge).get_gameObject().SetActive(false); } } if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.PieceGauge, (UnityEngine.Object)null)) { if (artifactParam != null) { this.PieceGauge.set_minValue(0.0f); ItemData itemDataByItemId = MonoSingleton <GameManager> .Instance.Player.FindItemDataByItemID(artifactParam.kakera); this.PieceGauge.set_maxValue((float)(int)MonoSingleton <GameManager> .Instance.GetRarityParam(artifactParam.rareini).ArtifactCreatePieceNum); this.PieceGauge.set_value(itemDataByItemId == null ? 0.0f : (float)itemDataByItemId.Num); ((Component)this.PieceGauge).get_gameObject().SetActive(true); } else { ((Component)this.PieceGauge).get_gameObject().SetActive(false); } } if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.Icon, (UnityEngine.Object)null)) { if (data != null || artifactParam != null) { string path = AssetPath.ArtifactIcon(data == null ? artifactParam : data.ArtifactParam); instance1.ApplyTextureAsync(this.Icon, path); } else { instance1.CancelTextureLoadRequest(this.Icon); this.Icon.set_texture((Texture)null); } } int index1 = 0; int index2 = 0; if (data != null) { index1 = (int)data.Rarity; index2 = (int)data.RarityCap; } else if (artifactParam != null) { index1 = artifactParam.rareini; index2 = artifactParam.raremax; } if (data != null || artifactParam != null) { bool flag1 = data != null && data.CheckEnableRarityUp() == ArtifactData.RarityUpResults.Success; if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.RarityUp, (UnityEngine.Object)null)) { this.RarityUp.SetActive(flag1); } if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.RarityUpBack, (UnityEngine.Object)null) && UnityEngine.Object.op_Inequality((UnityEngine.Object) this.DefaultBack, (UnityEngine.Object)null)) { ((Behaviour)this.RarityUpBack).set_enabled(flag1); ((Behaviour)this.DefaultBack).set_enabled(!flag1); } bool flag2 = false; if (artifactParam != null) { ItemData itemDataByItemId = MonoSingleton <GameManager> .Instance.Player.FindItemDataByItemID(artifactParam.kakera); if (itemDataByItemId != null) { RarityParam rarityParam = MonoSingleton <GameManager> .Instance.GetRarityParam(artifactParam.rareini); flag2 = itemDataByItemId.Num >= (int)rarityParam.ArtifactCreatePieceNum; } else { flag2 = false; } } if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.CanCreate, (UnityEngine.Object)null)) { this.CanCreate.SetActive(flag2); } if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.CanCreateBack, (UnityEngine.Object)null) && UnityEngine.Object.op_Inequality((UnityEngine.Object) this.DefaultBack, (UnityEngine.Object)null)) { ((Behaviour)this.CanCreateBack).set_enabled(flag2); ((Behaviour)this.DefaultBack).set_enabled(!flag2); } if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.CanCreateGauge, (UnityEngine.Object)null) && UnityEngine.Object.op_Inequality((UnityEngine.Object) this.DefaultBack, (UnityEngine.Object)null)) { ((Behaviour)this.CanCreateGauge).set_enabled(flag2); ((Behaviour)this.DefaultBack).set_enabled(!flag2); } if (this.NotCreateGrayIcon != null && this.NotCreateGrayIcon.Length > 0) { if (flag2) { for (int index3 = 0; index3 < this.NotCreateGrayIcon.Length; ++index3) { ((Graphic)this.NotCreateGrayIcon[index3]).set_color(Color.get_white()); } } else { for (int index3 = 0; index3 < this.NotCreateGrayIcon.Length; ++index3) { ((Graphic)this.NotCreateGrayIcon[index3]).set_color(Color.get_cyan()); } } } if (this.NotCreateGrayRawIcon != null && this.NotCreateGrayRawIcon.Length > 0) { if (flag2) { for (int index3 = 0; index3 < this.NotCreateGrayRawIcon.Length; ++index3) { ((Graphic)this.NotCreateGrayRawIcon[index3]).set_color(Color.get_white()); } } else { for (int index3 = 0; index3 < this.NotCreateGrayRawIcon.Length; ++index3) { ((Graphic)this.NotCreateGrayRawIcon[index3]).set_color(Color.get_cyan()); } } } if (data != null && UnityEngine.Object.op_Inequality((UnityEngine.Object) this.NotRarityUp, (UnityEngine.Object)null) && UnityEngine.Object.op_Inequality((UnityEngine.Object) this.CanRarityUp, (UnityEngine.Object)null)) { bool flag3 = (int)data.Rarity == (int)data.RarityCap; this.NotRarityUp.SetActive(flag3); this.CanRarityUp.SetActive(!flag3); } if (data != null && UnityEngine.Object.op_Inequality((UnityEngine.Object) this.RarityUpCost, (UnityEngine.Object)null)) { this.RarityUpCost.set_text(data.GetKakeraNeedNum().ToString()); } if (artifactParam != null && UnityEngine.Object.op_Inequality((UnityEngine.Object) this.TransmuteCost, (UnityEngine.Object)null)) { this.TransmuteCost.set_text((int)MonoSingleton <GameManager> .Instance.GetRarityParam(artifactParam.rareini).ArtifactCreatePieceNum.ToString()); } if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.PieceNum, (UnityEngine.Object)null)) { ItemData itemData = data == null ? MonoSingleton <GameManager> .Instance.Player.FindItemDataByItemID(artifactParam.kakera) : MonoSingleton <GameManager> .Instance.Player.FindItemDataByItemParam(data.Kakera); if (itemData != null) { this.PieceNum.set_text(itemData.Num.ToString()); if (data != null && data.CheckEnableRarityUp() == ArtifactData.RarityUpResults.Success) { ((Graphic)this.PieceNum).set_color(Color.get_yellow()); } else { ((Graphic)this.PieceNum).set_color(Color.get_white()); } } else { this.PieceNum.set_text("0"); ((Graphic)this.PieceNum).set_color(Color.get_white()); } } if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.Rarity, (UnityEngine.Object)null)) { GameSettings instance2 = GameSettings.Instance; if (UnityEngine.Object.op_Inequality((UnityEngine.Object)instance2, (UnityEngine.Object)null) && index1 < instance2.ArtifactIcon_Rarity.Length) { this.Rarity.set_sprite(instance2.ArtifactIcon_Rarity[index1]); } } if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.RarityMax, (UnityEngine.Object)null)) { GameSettings instance2 = GameSettings.Instance; if (UnityEngine.Object.op_Inequality((UnityEngine.Object)instance2, (UnityEngine.Object)null) && index2 < instance2.ArtifactIcon_RarityBG.Length) { this.RarityMax.set_sprite(instance2.ArtifactIcon_RarityBG[index2]); } } if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.RarityText, (UnityEngine.Object)null)) { this.RarityText.set_text((index1 + 1).ToString()); } if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.RarityMaxText, (UnityEngine.Object)null)) { this.RarityMaxText.set_text((index2 + 1).ToString()); } if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.Frame, (UnityEngine.Object)null)) { GameSettings instance2 = GameSettings.Instance; if (UnityEngine.Object.op_Inequality((UnityEngine.Object)instance2, (UnityEngine.Object)null) && index1 < instance2.ArtifactIcon_Frames.Length) { this.Frame.set_sprite(instance2.ArtifactIcon_Frames[index1]); } } if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.Category, (UnityEngine.Object)null)) { GameSettings instance2 = GameSettings.Instance; if (UnityEngine.Object.op_Inequality((UnityEngine.Object)instance2, (UnityEngine.Object)null) && (data != null || artifactParam != null)) { switch (data == null ? (int)artifactParam.type : (int)data.ArtifactParam.type) { case 1: this.Category.set_sprite(instance2.ArtifactIcon_Weapon); break; case 2: this.Category.set_sprite(instance2.ArtifactIcon_Armor); break; case 3: this.Category.set_sprite(instance2.ArtifactIcon_Misc); break; } } } if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.DecKakeraNum, (UnityEngine.Object)null)) { this.DecKakeraNum.set_text(data.GetKakeraChangeNum().ToString()); } if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.DecCost, (UnityEngine.Object)null)) { this.DecCost.set_text(data.RarityParam.ArtifactChangeCost.ToString()); } } else { if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.Rarity, (UnityEngine.Object)null)) { this.Rarity.set_sprite((Sprite)null); } if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.RarityMax, (UnityEngine.Object)null)) { this.RarityMax.set_sprite((Sprite)null); } if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.Frame, (UnityEngine.Object)null)) { this.Frame.set_sprite((Sprite)null); } if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.Category, (UnityEngine.Object)null)) { this.Category.set_sprite((Sprite)null); } } bool flag = false; if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.Owner, (UnityEngine.Object)null)) { if (data != null && this.SetOwnerIcon(instance1, data)) { this.Owner.SetActive(true); flag = true; } else { this.Owner.SetActive(false); } } if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.Favorite, (UnityEngine.Object)null)) { if (data != null && data.IsFavorite) { this.Favorite.SetActive(true); flag = true; } else { this.Favorite.SetActive(false); } } if (this.ForceMask) { flag = true; } if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.LockMask, (UnityEngine.Object)null)) { this.LockMask.SetActive(flag); } if (data == null) { return; } this.mLastExpNum = data.Exp; }
public void Setup(SkillAbilityDeriveParam skillAbilityDeriveParam, List <SkillAbilityDeriveParam> additionalSkillAbilityDeriveParams) { this.m_SkillDeriveData = new List <SkillDeriveData>(); this.m_AbilityDeriveData = new List <AbilityDeriveData>(); this.m_SkillAbilityDeriveParam = skillAbilityDeriveParam; IEnumerable <SkillDeriveData> collection1 = this.m_SkillAbilityDeriveParam.SkillDeriveParams.Select <SkillDeriveParam, SkillDeriveData>((Func <SkillDeriveParam, SkillDeriveData>)(param => new SkillDeriveData(param))); IEnumerable <AbilityDeriveData> collection2 = this.m_SkillAbilityDeriveParam.AbilityDeriveParams.Select <AbilityDeriveParam, AbilityDeriveData>((Func <AbilityDeriveParam, AbilityDeriveData>)(param => new AbilityDeriveData(param))); this.m_SkillDeriveData.AddRange(collection1); this.m_AbilityDeriveData.AddRange(collection2); Dictionary <string, int> dictionary = new Dictionary <string, int>(); using (List <SkillDeriveData> .Enumerator enumerator = this.m_SkillDeriveData.GetEnumerator()) { while (enumerator.MoveNext()) { SkillDeriveData current = enumerator.Current; if (!dictionary.ContainsKey(current.Param.BaseSkillIname)) { dictionary.Add(current.Param.BaseSkillIname, this.MasterIndex); } } } using (List <AbilityDeriveData> .Enumerator enumerator = this.m_AbilityDeriveData.GetEnumerator()) { while (enumerator.MoveNext()) { AbilityDeriveData current = enumerator.Current; if (!dictionary.ContainsKey(current.Param.BaseAbilityIname)) { dictionary.Add(current.Param.BaseAbilityIname, this.MasterIndex); } } } using (List <SkillAbilityDeriveParam> .Enumerator enumerator1 = additionalSkillAbilityDeriveParams.GetEnumerator()) { while (enumerator1.MoveNext()) { SkillAbilityDeriveParam current1 = enumerator1.Current; if (!this.m_AdditionalSkillAbilityDeriveParam.Contains(current1)) { this.m_AdditionalSkillAbilityDeriveParam.Add(current1); } List <SkillDeriveParam> skillDeriveParams = current1.SkillDeriveParams; List <AbilityDeriveParam> abilityDeriveParams = current1.AbilityDeriveParams; using (List <SkillDeriveParam> .Enumerator enumerator2 = skillDeriveParams.GetEnumerator()) { while (enumerator2.MoveNext()) { SkillDeriveParam current2 = enumerator2.Current; int num = -1; if (dictionary.TryGetValue(current2.BaseSkillIname, out num)) { num = Mathf.Min(current2.MasterIndex, num); dictionary[current2.BaseSkillIname] = num; } else { dictionary.Add(current2.BaseSkillIname, current2.MasterIndex); } this.m_SkillDeriveData.Add(new SkillDeriveData(current2) { IsAdd = true }); } } using (List <AbilityDeriveParam> .Enumerator enumerator2 = abilityDeriveParams.GetEnumerator()) { while (enumerator2.MoveNext()) { AbilityDeriveParam current2 = enumerator2.Current; int num = -1; if (dictionary.TryGetValue(current2.BaseAbilityIname, out num)) { num = Mathf.Min(current2.MasterIndex, num); dictionary[current2.BaseAbilityIname] = num; } else { dictionary.Add(current2.BaseAbilityIname, current2.MasterIndex); } this.m_AbilityDeriveData.Add(new AbilityDeriveData(current2) { IsAdd = true }); } } } } using (List <AbilityDeriveData> .Enumerator enumerator = this.m_AbilityDeriveData.GetEnumerator()) { while (enumerator.MoveNext()) { AbilityDeriveData current = enumerator.Current; int num = -1; if (dictionary.TryGetValue(current.Param.BaseAbilityIname, out num)) { current.IsDisable = current.Param.MasterIndex > num; } } } using (List <SkillDeriveData> .Enumerator enumerator = this.m_SkillDeriveData.GetEnumerator()) { while (enumerator.MoveNext()) { SkillDeriveData current = enumerator.Current; int num = -1; if (dictionary.TryGetValue(current.Param.BaseSkillIname, out num)) { current.IsDisable = current.Param.MasterIndex > num; } } } }