灵兽提交

zhangqiang 2020-10-24 18:14:00 +08:00
parent d36645cc7f
commit 1d67775000
5 changed files with 95 additions and 44 deletions

View File

@ -69,11 +69,20 @@ function this.GetShowPanelData()
Util.GetGameObject(proList[0].transform,"proName"):GetComponent("Text").text ="等级"
Util.GetGameObject(proList[0].transform,"proValue"):GetComponent("Text").text = pokemonBackData.level
Util.GetGameObject(proList[0].transform,"Image"):GetComponent("Image").sprite = Util.LoadSprite(PropertyTypeIconDef[1])
for i = 1, 4 do
Util.GetGameObject(proList[i].transform,"proName"):GetComponent("Text").text = ConfigManager.GetConfigData(ConfigName.PropertyConfig,i).Info
Util.GetGameObject(proList[i].transform,"proValue"):GetComponent("Text").text = allAddProVal[i]
Util.GetGameObject(proList[i].transform,"Image"):GetComponent("Image").sprite = Util.LoadSprite(PropertyTypeIconDef[i + 1])
local index = 0
for key, value in pairs(allAddProVal) do
index = index + 1
if proList[index] then
Util.GetGameObject(proList[index].transform,"proName"):GetComponent("Text").text = ConfigManager.GetConfigData(ConfigName.PropertyConfig,key).Info
Util.GetGameObject(proList[index].transform,"proValue"):GetComponent("Text").text = value
Util.GetGameObject(proList[index].transform,"Image"):GetComponent("Image").sprite = Util.LoadSprite(PropertyTypeIconDef[index + 1])
end
end
-- for i = 1, 4 do
-- Util.GetGameObject(proList[i].transform,"proName"):GetComponent("Text").text = ConfigManager.GetConfigData(ConfigName.PropertyConfig,i).Info
-- Util.GetGameObject(proList[i].transform,"proValue"):GetComponent("Text").text = allAddProVal[i]
-- Util.GetGameObject(proList[i].transform,"Image"):GetComponent("Image").sprite = Util.LoadSprite(PropertyTypeIconDef[i + 1])
-- end
local curSkillId = 0
local skillArray = ConfigManager.GetConfigData(ConfigName.SpiritAnimal,pokemonBackData.tempId).SkillArray
for i = 1, #skillArray do
@ -94,11 +103,20 @@ function this.NoGetShowPanelData()
--属性
local allAddProVal = PokemonManager.GetSinglePokemonAddProDataBySid(pokemonSid) --this.CalculateHeroAllProValList(heroSData,heroStar,heroStar ~= heroSData.Star)
proList[0]:SetActive(false)
for i = 1, 4 do
Util.GetGameObject(proList[i].transform,"proName"):GetComponent("Text").text = ConfigManager.GetConfigData(ConfigName.PropertyConfig,i).Info
Util.GetGameObject(proList[i].transform,"proValue"):GetComponent("Text").text = allAddProVal[i]
Util.GetGameObject(proList[i].transform,"Image"):GetComponent("Image").sprite = Util.LoadSprite(PropertyTypeIconDef[i + 1])
local index = 0
for key, value in pairs(allAddProVal) do
index = index + 1
if proList[index] then
Util.GetGameObject(proList[index].transform,"proName"):GetComponent("Text").text = ConfigManager.GetConfigData(ConfigName.PropertyConfig,key).Info
Util.GetGameObject(proList[index].transform,"proValue"):GetComponent("Text").text = value
Util.GetGameObject(proList[index].transform,"Image"):GetComponent("Image").sprite = Util.LoadSprite(PropertyTypeIconDef[index + 1])
end
end
-- for i = 1, 4 do
-- Util.GetGameObject(proList[i].transform,"proName"):GetComponent("Text").text = ConfigManager.GetConfigData(ConfigName.PropertyConfig,i).Info
-- Util.GetGameObject(proList[i].transform,"proValue"):GetComponent("Text").text = allAddProVal[i]
-- Util.GetGameObject(proList[i].transform,"Image"):GetComponent("Image").sprite = Util.LoadSprite(PropertyTypeIconDef[i + 1])
-- end
local curSkillId = 0
local skillArray = ConfigManager.GetConfigData(ConfigName.SpiritAnimal,pokemonSid).SkillArray
for i = 1, #skillArray do
@ -113,8 +131,9 @@ function this.NoGetShowPanelData()
end
function this.ShowPokemonLive(_heroSConfigData)
LogPink("_heroSConfigData.Live ".._heroSConfigData.Live)
this.testLiveGO = poolManager:LoadLive(GetResourcePath(_heroSConfigData.Live), this.liveRoot.transform,
Vector3.one * _heroSConfigData.Scale, Vector3.New(_heroSConfigData.Position[1], _heroSConfigData.Position[2], 0))
Vector3.one * _heroSConfigData.Scale * 0.7, Vector3.New(_heroSConfigData.Position[1], _heroSConfigData.Position[2], 0))
local SkeletonGraphic = this.testLiveGO:GetComponent("SkeletonGraphic")
local idle = function() SkeletonGraphic.AnimationState:SetAnimation(0, "idle", true) end
SkeletonGraphic.AnimationState.Complete = SkeletonGraphic.AnimationState.Complete + idle

View File

@ -177,14 +177,15 @@ function this.ShowSinglePokemonList(go,singleData,liveIndex)
Util.GetGameObject(go, "upZhenInfo/titleImage/nameText"):GetComponent("Text").text = ConfigManager.GetConfigData(ConfigName.SpiritAnimal,curData.id).Name
Util.GetGameObject(go, "upZhenInfo/lvImage/Text"):GetComponent("Text").text = "等级"..curData.lv
local curPokemonLive = Util.GetGameObject(go, "upZhenInfo/pokemonLive")
if live2dList and #live2dList > 0 then
if live2dList[liveIndex] then
poolManager:UnLoadLive(live2dList[liveIndex].name, live2dList[liveIndex].go, PoolManager.AssetType.GameObject)
live2dList[liveIndex] = nil
for key, value in pairs(live2dList) do
if key == liveIndex then
-- LogPink("live2dList[liveIndex].name "..live2dList[key].name)
poolManager:UnLoadLive(live2dList[key].name, live2dList[key].go, PoolManager.AssetType.GameObject)
live2dList[key] = nil
end
end
local LiveName = curData.live
local live2d = poolManager:LoadLive(LiveName, curPokemonLive.transform,Vector3.one * 0.2, Vector3.New(curData.position[1],curData.position[2],0))--curData.scale
local live2d = poolManager:LoadLive(LiveName, curPokemonLive.transform,Vector3.one *curData.scale * 0.4, Vector3.New(curData.position[1],curData.position[2],0))--curData.scale
live2dList[liveIndex] = {name=curData.live, go=live2d}
local starSize = Vector2.New(65,65)
SetHeroStars(Util.GetGameObject(go, "upZhenInfo/starGrid"), curData.star,1,starSize,0,Vector2.New(0.5,0.5))
@ -332,23 +333,16 @@ end
function PokemonMainPanel:OnClose()
ClearRedPointObject(RedPointType.Pokemon_Recruit, this.btnInfoRed)
ClearRedPointObject(RedPointType.Pokemon_Fetter, this.btnFetterRed)
poolManager:UnLoadLive(this.LiveName,this.LiveGO )
this.LiveName= nil
end
--界面销毁时调用(用于子类重写)
function PokemonMainPanel:OnDestroy()
SubUIManager.Close(this.UpView)
dragViewListGo={}
if live2dList and #live2dList > 0 then
for i = 1, #live2dList do
if live2dList[i] then
poolManager:UnLoadLive(live2dList[i].name, live2dList[i].go, PoolManager.AssetType.GameObject)
live2dList[i] = nil
end
end
end
for key, value in pairs(live2dList) do
poolManager:UnLoadLive(live2dList[key].name, live2dList[key].go, PoolManager.AssetType.GameObject)
live2dList[key] = nil
end
end
return PokemonMainPanel

View File

@ -97,13 +97,33 @@ function PokemonUpStarSuccessPanel:OnOpen(_curPokemonData)
local oldLvAllAddProVal = PokemonManager.GetSinglePokemonAddProData(curPokemonData.dynamicId,curPokemonData.star - 1)
--计算面板属性cur
local curLvAllAddProVal = PokemonManager.GetSinglePokemonAddProData(curPokemonData.dynamicId,curPokemonData.star)
for i = 1, 4 do
Util.GetGameObject(curPro[i],"curProName"):GetComponent("Text").text = propertyConfig[i].Info
Util.GetGameObject(curPro[i],"curProVale"):GetComponent("Text").text = oldLvAllAddProVal[i]
Util.GetGameObject(curPro[i],"Image"):GetComponent("Image").sprite = Util.LoadSprite(PropertyTypeIconDef[i])
Util.GetGameObject(nextPro[i],"curProName"):GetComponent("Text").text = propertyConfig[i].Info
Util.GetGameObject(nextPro[i],"curProVale"):GetComponent("Text").text = curLvAllAddProVal[i]
local index = 0
for key, value in pairs(oldLvAllAddProVal) do
index = index + 1
if curPro[index] then
Util.GetGameObject(curPro[index],"curProName"):GetComponent("Text").text = propertyConfig[key].Info
Util.GetGameObject(curPro[index],"curProVale"):GetComponent("Text").text = value
Util.GetGameObject(curPro[index],"Image"):GetComponent("Image").sprite = Util.LoadSprite(PropertyTypeIconDef[index])
end
end
local index2 = 0
for key, value in pairs(curLvAllAddProVal) do
index2 = index2 + 1
if nextPro[index2] then
Util.GetGameObject(nextPro[index2],"curProName"):GetComponent("Text").text = propertyConfig[key].Info
Util.GetGameObject(nextPro[index2],"curProVale"):GetComponent("Text").text = value
end
end
-- for i = 1, 4 do
-- Util.GetGameObject(curPro[i],"curProName"):GetComponent("Text").text = propertyConfig[i].Info
-- Util.GetGameObject(curPro[i],"curProVale"):GetComponent("Text").text = oldLvAllAddProVal[i]
-- Util.GetGameObject(curPro[i],"Image"):GetComponent("Image").sprite = Util.LoadSprite(PropertyTypeIconDef[i])
-- Util.GetGameObject(nextPro[i],"curProName"):GetComponent("Text").text = propertyConfig[i].Info
-- Util.GetGameObject(nextPro[i],"curProVale"):GetComponent("Text").text = curLvAllAddProVal[i]
-- end
local curSkillId = 0
local nextSkillId = 0

View File

@ -127,13 +127,22 @@ function this.ShowPokemonInfo()
index = index + 1
curAllPro[index] = singleProData
end
for i = 1, #proList do
if PropertyTypeIconDef[i] then
Util.GetGameObject(proList[i], "Image"):GetComponent("Image").sprite = Util.LoadSprite(PropertyTypeIconDef[i])
local index = 0
for key, value in pairs(curAllPro) do
index = index + 1
if proList[index] then
Util.GetGameObject(proList[index], "Image"):GetComponent("Image").sprite = Util.LoadSprite(PropertyTypeIconDef[index])
Util.GetGameObject(proList[index], "proName"):GetComponent("Text").text=curAllPro[key].proName
Util.GetGameObject(proList[index], "proValue"):GetComponent("Text").text=curAllPro[key].proValue
end
Util.GetGameObject(proList[i], "proName"):GetComponent("Text").text=curAllPro[i].proName
Util.GetGameObject(proList[i], "proValue"):GetComponent("Text").text=curAllPro[i].proValue
end
-- for i = 1, #proList do
-- if PropertyTypeIconDef[i] then
-- Util.GetGameObject(proList[i], "Image"):GetComponent("Image").sprite = Util.LoadSprite(PropertyTypeIconDef[i])
-- end
-- Util.GetGameObject(proList[i], "proName"):GetComponent("Text").text=curAllPro[i].proName
-- Util.GetGameObject(proList[i], "proValue"):GetComponent("Text").text=curAllPro[i].proValue
-- end
--技能
local curSkillId = PokemonManager.GetCurStarSkillId(curPokemonData.id,curPokemonData.star)
-- LogPink("curPokemonData.star "..curPokemonData.star)

View File

@ -43,16 +43,25 @@ end
--刷新面板
function this.RefreshPanel()
allProData = PokemonManager.GetPokemonFormationAddPro()
-- local curallProData = PokemonManager.GetPokemonFormationAddPro()
-- HeroManager.DoubleTableCompound(allProData, curallProData)
for i = 1, #allProPre do
local go= allProPre[i]
if PropertyTypeIconDef[i] then
Util.GetGameObject(go, "Image"):GetComponent("Image").sprite = Util.LoadSprite(PropertyTypeIconDef[i])
local index = 0
for key, value in pairs(allProData) do
index = index + 1
local go= allProPre[index]
if go then
Util.GetGameObject(go, "Image"):GetComponent("Image").sprite = Util.LoadSprite(PropertyTypeIconDef[index])
Util.GetGameObject(go,"proName"):GetComponent("Text").text=ConfigManager.GetConfigData(ConfigName.PropertyConfig,key).Info
Util.GetGameObject(go,"proValue"):GetComponent("Text").text= value
end
Util.GetGameObject(go,"proName"):GetComponent("Text").text=ConfigManager.GetConfigData(ConfigName.PropertyConfig,i).Info
Util.GetGameObject(go,"proValue"):GetComponent("Text").text= allProData[i]
end
-- for i = 1, #allProPre do
-- local go= allProPre[i]
-- if PropertyTypeIconDef[i] then
-- Util.GetGameObject(go, "Image"):GetComponent("Image").sprite = Util.LoadSprite(PropertyTypeIconDef[i])
-- end
-- Util.GetGameObject(go,"proName"):GetComponent("Text").text=ConfigManager.GetConfigData(ConfigName.PropertyConfig,i).Info
-- Util.GetGameObject(go,"proValue"):GetComponent("Text").text= allProData[i]
-- end
end
return this