コード例 #1
0
        // Token: 0x0601090B RID: 67851 RVA: 0x0044E4F4 File Offset: 0x0044C6F4
        private void ShowSelectSkillContent()
        {
            if (!BJLuaObjHelper.IsSkipLuaHotfix && this.TryInitHotFix("") && this.m_ShowSelectSkillContent_hotfix != null)
            {
                this.m_ShowSelectSkillContent_hotfix.call(new object[]
                {
                    this
                });
                return;
            }
            BJLuaObjHelper.IsSkipLuaHotfix = false;
            GameObjectUtility.DestroyChildren(this.m_infoAllSkillsContent);
            GameObjectUtility.DestroyChildren(this.m_infoSelectSkillsContent);
            GameObject assetInContainer = base.GetAssetInContainer <GameObject>("skillItem");
            List <int> skillIds         = this.m_hero.SkillIds;
            List <int> selectedSkills   = this.m_hero.SelectedSkills;

            this.m_curSelectSkillIds = new List <int>();
            this.m_curSelectSkillIds.AddRange(selectedSkills);
            foreach (int key in skillIds)
            {
                ConfigDataSkillInfo configDataSkillInfo = this.m_configDataLoader.GetConfigDataSkillInfo(key);
                GameObject          gameObject          = UnityEngine.Object.Instantiate <GameObject>(assetInContainer);
                PrefabControllerCreater.CreateAllControllers(gameObject);
                HeroSkillItemUIController component = gameObject.GetComponent <HeroSkillItemUIController>();
                component.EventOnShowDesc += this.OnSkillItemClick;
                component.InitSkillItem(configDataSkillInfo);
                bool limitTagObjActive = this.m_playerContext.IsSkillLimitToHeroJob(this.m_hero.ActiveHeroJobRelatedId, configDataSkillInfo.ID);
                component.SetLimitTagObjActive(limitTagObjActive);
                gameObject.transform.SetParent(this.m_infoAllSkillsContent.transform, false);
                if (selectedSkills.Contains(configDataSkillInfo.ID))
                {
                    component.SetSelectPanelActive(true);
                }
            }
            foreach (int key2 in skillIds)
            {
                ConfigDataSkillInfo configDataSkillInfo2 = this.m_configDataLoader.GetConfigDataSkillInfo(key2);
                if (selectedSkills.Contains(configDataSkillInfo2.ID))
                {
                    GameObject gameObject2 = UnityEngine.Object.Instantiate <GameObject>(assetInContainer);
                    PrefabControllerCreater.CreateAllControllers(gameObject2);
                    HeroSkillItemUIController component2 = gameObject2.GetComponent <HeroSkillItemUIController>();
                    component2.EventOnShowDesc += this.OnSkillItemClick;
                    component2.InitSkillItem(configDataSkillInfo2);
                    gameObject2.transform.SetParent(this.m_infoSelectSkillsContent.transform, false);
                }
            }
            UIUtility.SetGameObjectChildrenActiveCount(this.m_infoSelectSkillsCost, this.CalcTotalCostFromSkillList(selectedSkills));
            CommonUIStateController component3 = this.m_infoSelectSkillPanel.GetComponent <CommonUIStateController>();

            UIUtility.SetUIStateOpen(component3, "Show", null, false, true);
        }
コード例 #2
0
        // Token: 0x0601090D RID: 67853 RVA: 0x0044E8A0 File Offset: 0x0044CAA0
        private void OnLoadOrUnLoadButtonClick()
        {
            if (!BJLuaObjHelper.IsSkipLuaHotfix && this.TryInitHotFix("") && this.m_OnLoadOrUnLoadButtonClick_hotfix != null)
            {
                this.m_OnLoadOrUnLoadButtonClick_hotfix.call(new object[]
                {
                    this
                });
                return;
            }
            BJLuaObjHelper.IsSkipLuaHotfix = false;
            HeroSkillItemUIController curSelectedSkillCtrl = this.m_curSelectedSkillCtrl;
            ConfigDataSkillInfo       skillInfo            = curSelectedSkillCtrl.m_skillInfo;
            Transform parent = curSelectedSkillCtrl.gameObject.transform.parent;

            if (parent.gameObject == this.m_infoAllSkillsContent)
            {
                if (!this.m_curSelectSkillIds.Contains(skillInfo.ID))
                {
                    if (this.m_curSelectSkillIds.Count == 3)
                    {
                        CommonUIController.Instance.ShowMessage(StringTableId.StringTableId_Msg_SkillEquipNumMax, 2f, null, true);
                        return;
                    }
                    this.m_curSelectSkillIds.Add(skillInfo.ID);
                    int num = this.CalcTotalCostFromSkillList(this.m_curSelectSkillIds);
                    int heroSkillPointMax = this.m_playerContext.GetHeroSkillPointMax(this.m_hero.Level);
                    if (num > heroSkillPointMax)
                    {
                        CommonUIController.Instance.ShowMessage(StringTableId.StringTableId_Msg_SkillPointNotEnough, 2f, null, true);
                        this.m_curSelectSkillIds.Remove(skillInfo.ID);
                        return;
                    }
                    curSelectedSkillCtrl.SetSelectPanelActive(true);
                    GameObject assetInContainer = base.GetAssetInContainer <GameObject>("skillItem");
                    GameObject gameObject       = UnityEngine.Object.Instantiate <GameObject>(assetInContainer);
                    PrefabControllerCreater.CreateAllControllers(gameObject);
                    HeroSkillItemUIController component = gameObject.GetComponent <HeroSkillItemUIController>();
                    component.EventOnShowDesc += this.OnSkillItemClick;
                    component.InitSkillItem(skillInfo);
                    gameObject.transform.SetParent(this.m_infoSelectSkillsContent.transform, false);
                }
                else
                {
                    curSelectedSkillCtrl.SetSelectPanelActive(false);
                    for (int i = 0; i < this.m_infoSelectSkillsContent.transform.childCount; i++)
                    {
                        HeroSkillItemUIController component2 = this.m_infoSelectSkillsContent.transform.GetChild(i).GetComponent <HeroSkillItemUIController>();
                        if (component2.m_skillInfo == skillInfo)
                        {
                            this.m_curSelectSkillIds.Remove(component2.m_skillInfo.ID);
                            UnityEngine.Object.Destroy(this.m_infoSelectSkillsContent.transform.GetChild(i).gameObject);
                        }
                    }
                }
            }
            else if (parent.gameObject == this.m_infoSelectSkillsContent)
            {
                for (int j = 0; j < this.m_infoAllSkillsContent.transform.childCount; j++)
                {
                    HeroSkillItemUIController component3 = this.m_infoAllSkillsContent.transform.GetChild(j).GetComponent <HeroSkillItemUIController>();
                    if (component3.m_skillInfo == skillInfo)
                    {
                        component3.SetSelectPanelActive(false);
                        this.m_curSelectSkillIds.Remove(component3.m_skillInfo.ID);
                    }
                }
                UnityEngine.Object.Destroy(curSelectedSkillCtrl.gameObject);
            }
            this.m_infoSkillDescUnLoadButton.gameObject.SetActive(this.m_curSelectSkillIds.Contains(skillInfo.ID));
            UIUtility.SetGameObjectChildrenActiveCount(this.m_infoSelectSkillsCost, this.CalcTotalCostFromSkillList(this.m_curSelectSkillIds));
            this.CloseSkillDesc();
        }