神将技能修改提交

dev_chengFeng
jiaoyangna 2022-01-14 18:48:23 +08:00
parent 2df72a0edd
commit b0611db595
2 changed files with 979 additions and 334 deletions

View File

@ -70,9 +70,12 @@ function RoleInfoLayout:InitComponent()
this.posInfo = Util.GetGameObject(this.posBtn,"PosInfo"):GetComponent("Text")
this.proTip = Util.GetGameObject(self.gameObject,"content/pro/tishi")
this.skillGrid=Util.GetGameObject(self.gameObject,"content/skill")
this.skillGridCanvas = this.skillGrid:GetComponent("Canvas")
this.selsectSkillImage=Util.GetGameObject(this.skillGrid,"selsectSkillImage")
this.skillList = {}
this.skillBtnsList = {}
this.skillBtnsRoot = Util.GetGameObject(self.gameObject,"content/skillBtns")
this.skillGridCanvas = this.skillBtnsRoot:GetComponent("Canvas")
for i = 1,5 do
this.skillList[i] = {}
this.skillList[i].go = Util.GetGameObject(this.skillGrid,"sBg"..i)
@ -83,9 +86,12 @@ function RoleInfoLayout:InitComponent()
this.skillList[i].skillName = Util.GetGameObject(this.skillList[i].go,"skillName"):GetComponent("Text")
this.skillList[i].skillIma = Util.GetGameObject(this.skillList[i].go,"image")
this.skillList[i].frame = Util.GetGameObject(this.skillList[i].go,"frame"):GetComponent("Image")
this.skillBtnsList[i] = Util.GetGameObject(this.skillBtnsRoot,"sBg"..i)
end
this.line1 = Util.GetGameObject(this.skillGrid,"line1")
this.line2 = Util.GetGameObject(this.skillGrid,"line2")
this.line3 = Util.GetGameObject(this.skillBtnsRoot,"line1")
this.line4 = Util.GetGameObject(this.skillBtnsRoot,"line2")
this.upLv = Util.GetGameObject(self.gameObject,"content/upLv")
--升级
@ -192,11 +198,6 @@ function RoleInfoLayout:RemoveListener()
end
function this.SkillInfoPopupClose(panelType, p)
if panelType == UIName.SkillInfoPopup and this.skillPanel == p then --监听到SkillInfoPopup关闭把层级设回去
this.selsectSkillImage:SetActive(false)
this.skillPanel = nil
this.skillGridCanvas.sortingOrder = this.sortingOrder + 1
end
end
function RoleInfoLayout:OnShow()
@ -535,7 +536,7 @@ function this.UpdateHeroUpStarProUpSkillShowOld(skillGridGO,skillTabs,passiveSki
Util.SetGray(this.skillList[i].go,false)
end
Util.AddOnceClick(this.skillList[i].icon.gameObject, function()
this.SetSelectSkillImage(this.skillList[i].icon.gameObject)
this.SetSelectSkillImage(this.skillList[i].icon.gameObject)
local maxLv= HeroManager.GetHeroSkillMaxLevel(curHeroData.heroConfig.Id,this.skillData[i].skillConfig.Type)
if this.skillData[i].skillType == 0 then
this.skillPanel = UIManager.OpenPanel(UIName.SkillInfoPopup,this.skillData[i],1,10,maxLv,i,nil,GodSoulManager.GetGodSoulLv(curHeroData.dynamicId))
@ -561,16 +562,20 @@ end
--单个技能显示
function this.UpdateHeroUpStarProUpSkillShow(skillGridGO,skillTabs,passiveSkills)
this.skillPanelId = 0
this.skillGridCanvas.sortingOrder = this.sortingOrder + 1
this.skillData = this.GetSkillsData()
for i = 1,math.max(#this.skillList,#this.skillData) do
this.skillList[i].icon.gameObject:GetComponent("Button").onClick:RemoveAllListeners()
this.skillBtnsList[i].gameObject:GetComponent("Button").onClick:RemoveAllListeners()
if not this.skillData[i] then
this.skillList[i].go.gameObject:SetActive(false)
this.skillBtnsList[i].gameObject:SetActive(false)
elseif this.skillData[i].state == -1 then
this.skillList[i].go.gameObject:SetActive(false)
this.skillBtnsList[i].gameObject:SetActive(false)
else
this.skillList[i].go.gameObject:SetActive(true)
this.skillBtnsList[i].gameObject:SetActive(true)
if this.skillData[i].quality == 0 then
this.skillList[i].frame.gameObject:SetActive(false)
else
@ -603,42 +608,52 @@ function this.UpdateHeroUpStarProUpSkillShow(skillGridGO,skillTabs,passiveSkills
Util.SetGray(this.skillList[i].go,false)
end
Util.AddOnceClick(this.skillList[i].icon.gameObject, function()
Util.AddOnceClick(this.skillBtnsList[i].gameObject, function()
this.SetSelectSkillImage(this.skillList[i].icon.gameObject)
if this.skillPanel then
UIManager.ClosePanel(this.skillPanelId)
end
if this.skillData[i].Type < 5 then
local maxLv= HeroManager.GetHeroSkillMaxLevel(curHeroData.heroConfig.Id,this.skillData[i].Type)
if this.skillData[i].Type == 4 and this.skillData[i].state == 0 then
this.skillPanel = UIManager.OpenPanel(UIName.SkillInfoPopup,this.skillData[i],1,10,maxLv,i,nil,GodSoulManager.GetGodSoulLv(curHeroData.dynamicId),"\n<color=#FF0000>(法宝25级解锁)</color>")
this.skillPanelId = UIName.SkillInfoPopup
else
this.skillPanel = UIManager.OpenPanel(UIName.SkillInfoPopup,this.skillData[i],1,10,maxLv,i,nil,GodSoulManager.GetGodSoulLv(curHeroData.dynamicId))
end
this.skillGridCanvas.sortingOrder = this.skillPanel.sortingOrder + 1
this.skillPanelId = UIName.SkillInfoPopup
end
else
if this.skillPanel then
UIManager.ClosePanel(UIName.SkillInfoPopup)
end
if this.skillData[i].Type > 4 and this.skillData[i].Type < 9 then
UIManager.OpenPanel(UIName.RoleTalentPopup,curHeroData.heroConfig,curHeroData.breakId,curHeroData.upStarId)
this.skillPanel = UIManager.OpenPanel(UIName.RoleTalentPopup,curHeroData.heroConfig,curHeroData.breakId,curHeroData.upStarId)
this.skillPanelId = UIName.RoleTalentPopup
elseif this.skillData[i].Type == 9 then
if this.skillData[i].state == 0 then
UIManager.OpenPanel(UIName.RoleGodSoulLayout,curHeroData.heroConfig,11)
this.skillPanel = UIManager.OpenPanel(UIName.RoleGodSoulLayout,curHeroData.heroConfig,11)
this.skillPanelId = UIName.RoleGodSoulLayout
else
UIManager.OpenPanel(UIName.RoleGodSoulLayout,curHeroData)
this.skillPanel = UIManager.OpenPanel(UIName.RoleGodSoulLayout,curHeroData)
this.skillPanelId = UIName.RoleGodSoulLayout
end
end
end
end
this.skillGridCanvas.sortingOrder = this.skillPanel.sortingOrder + 1
end)
end
end
if #this.skillData > 2 then
this.line1.gameObject:SetActive(true)
this.line3.gameObject:SetActive(true)
else
this.line1.gameObject:SetActive(false)
this.line3.gameObject:SetActive(false)
end
if #this.skillData > 4 then
this.line2.gameObject:SetActive(true)
this.line4.gameObject:SetActive(true)
else
this.line2.gameObject:SetActive(false)
this.line4.gameObject:SetActive(false)
end
end