private void OnClickSelectPssiveSkillItem(GameObject go) { if (go == null || go.GetComponent <SkillPassiveBtnItem>() == null) { return; } SkillPassiveBtnItem component = go.GetComponent <SkillPassiveBtnItem>(); bool flag = SkillUIManager.Instance.CheckArtifactSkillIsUnlock(component.ArtifactSkillData.id); this.RefreshSelectPassiveSkillItemData(component); }
private void RefreshSelectPassiveSkillItemData(SkillPassiveBtnItem passiveBtnItem) { if (passiveBtnItem == null) { return; } this.lastSelectPassiveSkillBtnItem = this.currentSelectPsssiveSkillBtnItem; if (this.lastSelectPassiveSkillBtnItem != null) { this.lastSelectPassiveSkillBtnItem.Selected = false; } this.currentSelectPsssiveSkillBtnItem = passiveBtnItem; this.currentSelectPsssiveSkillBtnItem.Selected = true; this.currentSelectPassiveSkillID = this.currentSelectPsssiveSkillBtnItem.ArtifactSkillData.id; this.RefreshBeActivityDownDetail(this.currentSelectPassiveSkillID); }
private void RefreshPassiveSkillData() { List <ArtifactSkill> allArtifactSkillCfgData = SkillUIManager.Instance.GetAllArtifactSkillCfgData(); if (allArtifactSkillCfgData == null) { return; } for (int i = 0; i < allArtifactSkillCfgData.get_Count(); i++) { ArtifactSkill artifactSkill = allArtifactSkillCfgData.get_Item(i); Transform transform = null; if (i < this.beActivitySkillGridsTrans.get_childCount()) { transform = this.beActivitySkillGridsTrans.GetChild(i); } if (transform == null) { GameObject instantiate2Prefab = ResourceManager.GetInstantiate2Prefab("SkillPassiveBtnItem"); instantiate2Prefab.set_name("SkillPassiveBtnItem" + i); instantiate2Prefab.get_transform().SetParent(this.beActivitySkillGridsTrans); instantiate2Prefab.GetComponent <RectTransform>().set_localScale(Vector3.get_one()); instantiate2Prefab.GetComponent <ButtonCustom>().onClickCustom = new ButtonCustom.VoidDelegateObj(this.OnClickSelectPssiveSkillItem); instantiate2Prefab.SetActive(true); transform = instantiate2Prefab.get_transform(); } if (transform == null) { return; } SkillPassiveBtnItem skillPassiveBtnItem = transform.GetComponent <SkillPassiveBtnItem>(); if (skillPassiveBtnItem == null) { skillPassiveBtnItem = transform.get_gameObject().AddComponent <SkillPassiveBtnItem>(); } skillPassiveBtnItem.UpdatePassiveSkillItem(artifactSkill); skillPassiveBtnItem.Selected = false; if ((this.currentSelectPassiveSkillID > 0 && this.currentSelectPassiveSkillID == artifactSkill.id) || (this.currentSelectPassiveSkillID <= 0 && i == 0)) { this.RefreshSelectPassiveSkillItemData(skillPassiveBtnItem); } } }