示例#1
0
    private void RefreshRuneStoneDataBySkillID(int skillID)
    {
        Dictionary <int, List <Runes_basic> > runeInfoDataBySkillID = SkillRuneManager.Instance.GetRuneInfoDataBySkillID(skillID);

        if (runeInfoDataBySkillID == null)
        {
            return;
        }
        if (!SkillRuneManager.Instance.CheckHaveUnLockRuneStonBySkillID(skillID))
        {
            this.runeUpgradePanelTrans.FindChild("NoRuneStoneRoot").get_gameObject().SetActive(true);
            this.runeUpgradePanelTrans.FindChild("HaveRuneStoneRoot").get_gameObject().SetActive(false);
            return;
        }
        this.runeUpgradePanelTrans.FindChild("NoRuneStoneRoot").get_gameObject().SetActive(false);
        this.runeUpgradePanelTrans.FindChild("HaveRuneStoneRoot").get_gameObject().SetActive(true);
        for (int i = 0; i < 4; i++)
        {
            Transform transform = this.runeStoneGroupTransList.get_Item(i);
            if (runeInfoDataBySkillID != null && runeInfoDataBySkillID.ContainsKey(i + 1))
            {
                List <Runes_basic> list = runeInfoDataBySkillID.get_Item(i + 1);
                for (int j = 0; j < list.get_Count(); j++)
                {
                    Transform transform2 = null;
                    if (j < transform.get_childCount())
                    {
                        transform2 = transform.GetChild(j);
                    }
                    if (transform2 == null)
                    {
                        GameObject instantiate2Prefab = ResourceManager.GetInstantiate2Prefab("SKillRuneStoneItem");
                        instantiate2Prefab.set_name("RuneStoneItemGroup" + i);
                        instantiate2Prefab.get_transform().SetParent(transform);
                        instantiate2Prefab.GetComponent <RectTransform>().set_localScale(Vector3.get_one());
                        instantiate2Prefab.GetComponent <ButtonCustom>().onClickCustom = new ButtonCustom.VoidDelegateObj(this.OnClickSelectRuneStone);
                        transform2 = instantiate2Prefab.get_transform();
                    }
                    if (transform2 == null)
                    {
                        return;
                    }
                    SkillRuneStoneItem skillRuneStoneItem = transform2.GetComponent <SkillRuneStoneItem>();
                    if (skillRuneStoneItem == null)
                    {
                        skillRuneStoneItem = transform2.get_gameObject().AddComponent <SkillRuneStoneItem>();
                    }
                    skillRuneStoneItem.UpdateUI(list.get_Item(j), skillID);
                    skillRuneStoneItem.Selected = false;
                    int skillEmbedGroupIndex = SkillRuneManager.Instance.GetSkillEmbedGroupIndex(skillID);
                    if ((skillEmbedGroupIndex > 0 && skillEmbedGroupIndex == i + 1) || (skillEmbedGroupIndex <= 0 && i == 0))
                    {
                        this.RefreshSelectRuneStoneData(skillRuneStoneItem);
                    }
                }
            }
        }
        this.PlayUnlockRuneStoneFX(skillID);
    }
示例#2
0
    private void RefreshRuneStoneData(int skillID = 1401011)
    {
        Dictionary <int, List <Runes_basic> > runeInfoDataBySkillID = SkillRuneManager.Instance.GetRuneInfoDataBySkillID(skillID);

        for (int i = 0; i < 4; i++)
        {
            Transform transform = this.runeStoneGroupTransList.get_Item(i);
            if (runeInfoDataBySkillID != null && runeInfoDataBySkillID.ContainsKey(i + 1) && transform != null)
            {
                List <Runes_basic> list = runeInfoDataBySkillID.get_Item(i + 1);
                for (int j = 0; j < list.get_Count(); j++)
                {
                    Transform transform2 = null;
                    if (j < transform.get_childCount())
                    {
                        transform2 = transform.GetChild(j);
                    }
                    if (transform2 == null)
                    {
                        GameObject instantiate2Prefab = ResourceManager.GetInstantiate2Prefab("SKillRuneStoneItem");
                        instantiate2Prefab.set_name("RuneStoneItem" + (j + 1));
                        instantiate2Prefab.get_transform().SetParent(transform);
                        instantiate2Prefab.GetComponent <RectTransform>().set_localScale(Vector3.get_one());
                        instantiate2Prefab.GetComponent <ButtonCustom>().onClickCustom = new ButtonCustom.VoidDelegateObj(this.OnClickSelectRuneStone);
                        transform2 = instantiate2Prefab.get_transform();
                    }
                    if (transform2 == null)
                    {
                        return;
                    }
                    SkillRuneStoneItem skillRuneStoneItem = transform2.GetComponent <SkillRuneStoneItem>();
                    if (skillRuneStoneItem == null)
                    {
                        skillRuneStoneItem = transform2.get_gameObject().AddComponent <SkillRuneStoneItem>();
                    }
                    skillRuneStoneItem.UpdateUI(list.get_Item(j), skillID);
                    skillRuneStoneItem.Selected = false;
                    if (this.currentSelectRuneStoneID == list.get_Item(j).id)
                    {
                        skillRuneStoneItem.Selected = true;
                    }
                }
            }
        }
    }