我要变强界面匹配当前版本修改

dev_chengFeng
gaoxin 2020-08-26 15:16:17 +08:00
parent dfac8836db
commit 9ff8dbf943
3 changed files with 3153 additions and 58 deletions

View File

@ -28,13 +28,13 @@ function TempPool:GetNode(type, parent)
self.UsedIndex[type] = self.UsedIndex[type] + 1 self.UsedIndex[type] = self.UsedIndex[type] + 1
local node = newObjToParent(mom, parent) local node = newObjToParent(mom, parent)
table.insert(self.NodeList[type], node) table.insert(self.NodeList[type], node)
node.transform.localPosition = Vector3.New(0 ,0,0) node.transform.localPosition = Vector3.New(0 ,0, 0)
return node return node
end end
self.UsedIndex[type] = self.UsedIndex[type] + 1 self.UsedIndex[type] = self.UsedIndex[type] + 1
local node = self.NodeList[type][self.UsedIndex[type]] local node = self.NodeList[type][self.UsedIndex[type]]
node.transform:SetParent(parent.transform) node.transform:SetParent(parent.transform)
node.transform.localPosition = Vector3.New(0 ,0,0) node.transform.localPosition = Vector3.New(0 ,0, 0)
node:SetActive(true) node:SetActive(true)
return node return node
end end
@ -101,9 +101,15 @@ function GiveMePowerPanel:InitComponent()
this.groupBox = Util.GetGameObject(this.heroPanel, "demons") this.groupBox = Util.GetGameObject(this.heroPanel, "demons")
this.heroChoose = Util.GetGameObject(this.heroPanel, "demons/choose") this.heroChoose = Util.GetGameObject(this.heroPanel, "demons/choose")
this.btnAddHero = Util.GetGameObject(this.heroPanel, "demons/add")
this.btnMyGroup = Util.GetGameObject(this.heroPanel, "orggroup") this.btnMyGroup = Util.GetGameObject(this.heroPanel, "orggroup")
this.btnAddHero = {}
this.groupBox = {}
for i = 1, 6 do
this.btnAddHero[i] = Util.GetGameObject(this.heroPanel, "demons/add"..i)
this.groupBox[i] = Util.GetGameObject(this.heroPanel, "demons/item"..i)
end
this.curHeroName = Util.GetGameObject(this.heroPanel, "curHero/name"):GetComponent("Text") this.curHeroName = Util.GetGameObject(this.heroPanel, "curHero/name"):GetComponent("Text")
this.curHeroProgress = Util.GetGameObject(this.heroPanel, "curHero/progress"):GetComponent("Slider") this.curHeroProgress = Util.GetGameObject(this.heroPanel, "curHero/progress"):GetComponent("Slider")
this.curHeroGrade = Util.GetGameObject(this.heroPanel, "curHero/progress/Text"):GetComponent("Text") this.curHeroGrade = Util.GetGameObject(this.heroPanel, "curHero/progress/Text"):GetComponent("Text")
@ -133,11 +139,13 @@ function GiveMePowerPanel:BindEvent()
Util.AddClick(this.btnMyGroup, function() Util.AddClick(this.btnMyGroup, function()
--UIManager.OpenPanel(UIName.FormationPanel, FORMATION_TYPE.MAIN) --UIManager.OpenPanel(UIName.FormationPanel, FORMATION_TYPE.MAIN)
--JumpManager.GoJump(1013) --JumpManager.GoJump(1013)
UIManager.OpenPanel(UIName.FormationPanelV2, FORMATION_TYPE.MAIN) UIManager.OpenPanel(UIName.FormationPanelV2, FORMATION_TYPE.SAVE_FORMATION)
end)
Util.AddClick(this.btnAddHero, function()
JumpManager.GoJump(1023)
end) end)
for i = 1, 6 do
Util.AddOnceClick(this.btnAddHero[i], function()
UIManager.OpenPanel(UIName.FormationPanelV2, FORMATION_TYPE.SAVE_FORMATION)
end)
end
-- 初始化Tab管理器 -- 初始化Tab管理器
this.TabCtrl = TabBox.New() this.TabCtrl = TabBox.New()
@ -180,29 +188,27 @@ function this.RefreshHeroPanelShow()
-- --
local power = 0 local power = 0
local formationData = FormationManager.GetFormationByID(FormationManager.curFormationIndex) local formationData = FormationManager.GetFormationByID(FormationManager.curFormationIndex)
for i = 1, 5 do
local go = this.groupBox.transform:GetChild(i-1).gameObject
if formationData.teamHeroInfos[i] then
go:SetActive(true)
local heroDId = formationData.teamHeroInfos[i].heroId
local allEquipAddProVal = HeroManager.CalculateHeroAllProValList(1, heroDId, false)
power = power + allEquipAddProVal[HeroProType.WarPower]
local heroData = HeroManager.GetSingleHeroData(heroDId)
this.SingleHeroDataShow(go, heroData, i)
if i == 1 then for i = 1, 6 do
this.ChooseHero(go, heroData, i) this.groupBox[i]:SetActive(false)
end this.btnAddHero[i]:SetActive(true)
else
go:SetActive(false)
end
end end
for _, hero in pairs(formationData.teamHeroInfos) do
local pos = hero.position
this.groupBox[pos]:SetActive(true)
this.btnAddHero[pos]:SetActive(false)
local heroNum = #formationData.teamHeroInfos
this.btnAddHero:SetActive(heroNum < 5) local heroDId = hero.heroId
if heroNum < 5 then local allEquipAddProVal = HeroManager.CalculateHeroAllProValList(1, heroDId, false)
local pos = this.groupBox.transform:GetChild(heroNum).transform.localPosition power = power + allEquipAddProVal[HeroProType.WarPower]
this.btnAddHero.transform.localPosition = pos local heroData = HeroManager.GetSingleHeroData(heroDId)
this.SingleHeroDataShow(this.groupBox[pos], heroData, pos)
if not this._CurHeroIndex or this._CurHeroIndex > pos then
this.ChooseHero(this.groupBox[pos], heroData, pos)
end
end end
this.forceValue.text = power this.forceValue.text = power
end end

View File

@ -1,4 +1,4 @@
 require("Base/BasePanel") require("Base/BasePanel")
RoleListPanel = Inherit(BasePanel) RoleListPanel = Inherit(BasePanel)
local this = RoleListPanel local this = RoleListPanel
local sortType = 1 -- 1品阶 2等级 local sortType = 1 -- 1品阶 2等级