public void OnPointerHoldStart() { ArtifactDetailWindow componentInParent = (ArtifactDetailWindow)((Component)this).GetComponentInParent <ArtifactDetailWindow>(); if (!Object.op_Inequality((Object)componentInParent, (Object)null)) { return; } AbilityDetailWindow.SetBindAbility(this.mAbilityParam); componentInParent.OpenAbilityDetail(); }
private void _OnAbilityDetail(GameObject go) { GlobalVars.SelectedAbilityID.Set(string.Empty); GlobalVars.SelectedAbilityUniqueID.Set(0L); AbilityData dataOfClass1 = DataSource.FindDataOfClass <AbilityData>(go, (AbilityData)null); if (dataOfClass1 != null) { GlobalVars.SelectedAbilityID.Set(dataOfClass1.Param.iname); GlobalVars.SelectedAbilityUniqueID.Set(dataOfClass1.UniqueID); } else { AbilityParam dataOfClass2 = DataSource.FindDataOfClass <AbilityParam>(go, (AbilityParam)null); GlobalVars.SelectedAbilityID.Set(dataOfClass2 == null ? (string)null : dataOfClass2.iname); } if (string.IsNullOrEmpty((string)GlobalVars.SelectedAbilityID)) { return; } EventSystem current = EventSystem.get_current(); if (UnityEngine.Object.op_Inequality((UnityEngine.Object)current, (UnityEngine.Object)null)) { ((Behaviour)current).set_enabled(false); ((Behaviour)current).set_enabled(true); } GameSettings instance = GameSettings.Instance; if (!string.IsNullOrEmpty(instance.Dialog_AbilityDetail)) { GameObject gameObject = AssetManager.Load <GameObject>(instance.Dialog_AbilityDetail); if (UnityEngine.Object.op_Inequality((UnityEngine.Object)gameObject, (UnityEngine.Object)null)) { UnityEngine.Object.Instantiate <GameObject>((M0)gameObject); } } bool flag = false; if (UnityEngine.Object.op_Implicit((UnityEngine.Object)go)) { ListItemEvents component = (ListItemEvents)go.GetComponent <ListItemEvents>(); if (UnityEngine.Object.op_Implicit((UnityEngine.Object)component)) { flag = component.IsEnableSkillChange; } } AbilityDetailWindow.IsEnableSkillChange = flag; AbilityDetailWindow.SetBindObject(this.Unit); FlowNode_GameObject.ActivateOutputLinks((Component)this, 100); }
public void OpenAbilityDetail(GameObject obj) { AbilityParam dataOfClass = DataSource.FindDataOfClass <AbilityParam>(obj, (AbilityParam)null); if (dataOfClass != null) { AbilityDetailWindow.SetBindAbility(dataOfClass); } if (this.OnDetailOpen == null) { return; } this.OnDetailOpen.Invoke(obj); }
private void Refresh() { UnitData data1 = (UnitData)null; if (UnityEngine.Object.op_Implicit((UnityEngine.Object)UnitEnhanceV3.Instance)) { data1 = UnitEnhanceV3.Instance.CurrentUnit; } if (data1 == null) { data1 = MonoSingleton <GameManager> .Instance.Player.FindUnitDataByUniqueID((long)GlobalVars.SelectedUnitUniqueID); } if (data1 == null && AbilityDetailWindow.BindUnit != null) { data1 = AbilityDetailWindow.BindUnit; } if (data1 == null && AbilityDetailWindow.BindAbility == null) { DebugUtility.LogError("Not found bind unit data."); } else { if (AbilityDetailWindow.BindAbility != null) { DataSource.Bind <AbilityParam>(((Component)this).get_gameObject(), AbilityDetailWindow.BindAbility); if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.SkillTemplate, (UnityEngine.Object)null)) { List <AbilityDetailWindow.ViewContentParam> viewContentParams = new List <AbilityDetailWindow.ViewContentParam>(); if (AbilityDetailWindow.BindAbility.skills != null) { for (int index = 0; index < AbilityDetailWindow.BindAbility.skills.Length; ++index) { SkillParam skillParam = MonoSingleton <GameManager> .Instance.GetSkillParam(AbilityDetailWindow.BindAbility.skills[index].iname); AbilityDetailWindow.AddSkillParam(viewContentParams, skillParam, (SkillDeriveParam)null); } } for (int index = 0; index < viewContentParams.Count; ++index) { GameObject gameObject = (GameObject)UnityEngine.Object.Instantiate <GameObject>((M0)this.SkillTemplate); SkillDeriveList componentInChildren = (SkillDeriveList)gameObject.GetComponentInChildren <SkillDeriveList>(); componentInChildren.Setup(viewContentParams[index].m_SkillParam, viewContentParams[index].m_SkillDeriveParams); gameObject.get_transform().SetParent(this.SkillLayoutParent, false); gameObject.SetActive(true); this.m_SkillDeriveList.Add(componentInChildren); } } } else { AbilityData data2 = data1.GetAbilityData((long)GlobalVars.SelectedAbilityUniqueID); AbilityParam abilityParam = MonoSingleton <GameManager> .Instance.GetAbilityParam((string)GlobalVars.SelectedAbilityID); QuestClearUnlockUnitDataParam[] unlockedSkills = data1.UnlockedSkills; List <QuestClearUnlockUnitDataParam> unlockUnitDataParamList = new List <QuestClearUnlockUnitDataParam>(); QuestClearUnlockUnitDataParam[] allUnlockUnitDatas = MonoSingleton <GameManager> .Instance.MasterParam.GetAllUnlockUnitDatas(); if (allUnlockUnitDatas != null) { for (int index = 0; index < allUnlockUnitDatas.Length; ++index) { QuestClearUnlockUnitDataParam param = allUnlockUnitDatas[index]; if (param.type == QuestClearUnlockUnitDataParam.EUnlockTypes.Skill && param.uid == data1.UnitID && param.parent_id == abilityParam.iname && (unlockedSkills == null || Array.FindIndex <QuestClearUnlockUnitDataParam>(unlockedSkills, (Predicate <QuestClearUnlockUnitDataParam>)(p => p.iname == param.iname)) == -1)) { unlockUnitDataParamList.Add(param); } } } if (data2 != null && data2.Param != null && data2.IsDeriveBaseAbility) { data2 = data2.DerivedAbility; } RarityParam rarityParam = MonoSingleton <GameManager> .Instance.GetRarityParam((int)data1.UnitParam.raremax); int num = Math.Min((int)rarityParam.UnitLvCap + (int)rarityParam.UnitAwakeLvCap, abilityParam.GetRankCap()); DataSource.Bind <UnitData>(((Component)this).get_gameObject(), data1); DataSource.Bind <AbilityData>(((Component)this).get_gameObject(), data2); AbilityParam data3 = abilityParam; if (AbilityDetailWindow.IsEnableSkillChange) { string key = data1.SearchAbilityReplacementSkill(abilityParam.iname); if (!string.IsNullOrEmpty(key)) { data3 = MonoSingleton <GameManager> .Instance.GetAbilityParam(key); } } DataSource.Bind <AbilityParam>(((Component)this).get_gameObject(), data3); if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.SkillTemplate, (UnityEngine.Object)null)) { List <AbilityDetailWindow.ViewContentParam> viewContentParams = new List <AbilityDetailWindow.ViewContentParam>(); if (data2 != null && data2.LearningSkills != null) { for (int index1 = 0; index1 < data2.LearningSkills.Length; ++index1) { if (data2.LearningSkills[index1].locklv <= num) { string str1 = data2.LearningSkills[index1].iname; if (unlockedSkills != null) { for (int index2 = 0; index2 < unlockedSkills.Length; ++index2) { if (unlockedSkills[index2].old_id == str1) { str1 = unlockedSkills[index2].new_id; break; } } } if (AbilityDetailWindow.IsEnableSkillChange) { string str2 = data1.SearchReplacementSkill(str1); if (!string.IsNullOrEmpty(str2)) { str1 = str2; } } SkillData[] deriveSkills = data2.FindDeriveSkills(str1); if (deriveSkills.Length > 0) { foreach (SkillData skillData in deriveSkills) { AbilityDetailWindow.AddSkillParam(viewContentParams, skillData.SkillParam, skillData.DeriveParam); } } else { AbilityDetailWindow.AddSkillParam(viewContentParams, MonoSingleton <GameManager> .Instance.GetSkillParam(str1), (SkillDeriveParam)null); } } } if (unlockedSkills != null) { for (int index = 0; index < unlockedSkills.Length; ++index) { if (unlockedSkills[index].add && unlockedSkills[index].parent_id == data2.AbilityID) { AbilityDetailWindow.AddSkillParam(viewContentParams, MonoSingleton <GameManager> .Instance.GetSkillParam(unlockedSkills[index].new_id), (SkillDeriveParam)null); } } } } else { for (int index = 0; index < abilityParam.skills.Length; ++index) { if (abilityParam.skills[index].locklv <= num) { AbilityDetailWindow.AddSkillParam(viewContentParams, MonoSingleton <GameManager> .Instance.GetSkillParam(abilityParam.skills[index].iname), (SkillDeriveParam)null); } } } if (data1.MasterAbility != null && data1.CollaboAbility != null) { AbilityData abilityData = data1.MasterAbility; if (data1.MasterAbility.IsDeriveBaseAbility) { abilityData = data1.MasterAbility.DerivedAbility; } if (abilityData == data2) { using (List <SkillData> .Enumerator enumerator = data1.CollaboAbility.Skills.GetEnumerator()) { while (enumerator.MoveNext()) { SkillData current = enumerator.Current; AbilityDetailWindow.AddSkillParam(viewContentParams, current.SkillParam, (SkillDeriveParam)null); } } } } for (int index = 0; index < viewContentParams.Count; ++index) { GameObject gameObject = (GameObject)UnityEngine.Object.Instantiate <GameObject>((M0)this.SkillTemplate); SkillDeriveList componentInChildren = (SkillDeriveList)gameObject.GetComponentInChildren <SkillDeriveList>(); componentInChildren.Setup(viewContentParams[index].m_SkillParam, viewContentParams[index].m_SkillDeriveParams); gameObject.get_transform().SetParent(this.SkillLayoutParent, false); gameObject.SetActive(true); this.m_SkillDeriveList.Add(componentInChildren); } for (int index = 0; index < unlockUnitDataParamList.Count; ++index) { GameObject gameObject = (GameObject)UnityEngine.Object.Instantiate <GameObject>((M0)this.SkillLockedTemplate); DataSource.Bind <SkillParam>(gameObject, MonoSingleton <GameManager> .Instance.GetSkillParam(unlockUnitDataParamList[index].new_id)); DataSource.Bind <QuestClearUnlockUnitDataParam>(gameObject, unlockUnitDataParamList[index]); gameObject.get_transform().SetParent(this.SkillLayoutParent, false); gameObject.SetActive(true); } for (int index = 0; index < viewContentParams.Count; ++index) { if (viewContentParams[index].m_SkillDeriveParams != null && viewContentParams[index].m_SkillDeriveParams.Count >= 1) { this.m_ShowBaseToggle.set_interactable(true); break; } } } } GameParameter.UpdateAll(((Component)this).get_gameObject()); } }