灵兽修改提交

zhangqiang 2020-10-26 10:10:29 +08:00
parent aff128d50a
commit 3fa9583f56
3 changed files with 17 additions and 13 deletions

View File

@ -11,7 +11,7 @@ local pokemonDatas--所有灵兽list信息
local itemConfig = ConfigManager.GetConfig(ConfigName.ItemConfig)
local heroRankupConfig = ConfigManager.GetConfig(ConfigName.HeroRankupConfig)
local propertyConfig = ConfigManager.GetConfig(ConfigName.PropertyConfig)
local index--当前灵兽在 灵兽列表中的索引
local curDataByListIndex--当前灵兽在 灵兽列表中的索引
local allAddProVal={}--所有属性加成值
local isClickLeftOrRightBtn = true--点击左右按钮切换灵兽播放动画状态
local upZhenDidis
@ -251,8 +251,8 @@ end
function this.OnShowData()
isClickLeftOrRightBtn = true
for i = 1, #pokemonDatas do
if curPokemonData == pokemonDatas[i] then
index = i
if curPokemonData.dynamicId == pokemonDatas[i].dynamicId then
curDataByListIndex = i
end
end
this.UpdateLiveList()--加载当前 和 左右数据
@ -297,10 +297,10 @@ end
--更新界面已存数据
function this.UpdateLiveList()
local leftIndex = (index - 1 > 0 and index - 1 or #pokemonDatas)
local leftIndex = (curDataByListIndex - 1 > 0 and curDataByListIndex - 1 or #pokemonDatas)
leftPokemonData = pokemonDatas[leftIndex]
curPokemonData = pokemonDatas[index]
local rightIndex = (index + 1 <= #pokemonDatas and index + 1 or 1)
curPokemonData = pokemonDatas[curDataByListIndex]
local rightIndex = (curDataByListIndex + 1 <= #pokemonDatas and curDataByListIndex + 1 or 1)
rightPokemonData = pokemonDatas[rightIndex]
-- LogPink(leftIndex.." "..index.." "..rightIndex)
end
@ -346,9 +346,9 @@ function this.RightBtnOnClick()
end
isClickLeftOrRightBtn = false
this.rightBtn:GetComponent("Button").enabled = false
local oldIndexConfigData = pokemonDatas[index]
index = (index + 1 <= #pokemonDatas and index + 1 or 1)
curPokemonData = pokemonDatas[index]
local oldIndexConfigData = pokemonDatas[curDataByListIndex]
curDataByListIndex = (curDataByListIndex + 1 <= #pokemonDatas and curDataByListIndex + 1 or 1)
curPokemonData = pokemonDatas[curDataByListIndex]
if this.leftLiveObj then
poolManager:UnLoadLive(leftPokemonData.live, this.leftLiveObj)
this.leftLiveObj = nil
@ -376,9 +376,9 @@ function this.LeftBtnOnClick()
end
isClickLeftOrRightBtn = false
this.leftBtn:GetComponent("Button").enabled = false
local oldIndexConfigData = pokemonDatas[index]
index = (index - 1 > 0 and index - 1 or #pokemonDatas)
curPokemonData = pokemonDatas[index]
local oldIndexConfigData = pokemonDatas[curDataByListIndex]
curDataByListIndex = (curDataByListIndex - 1 > 0 and curDataByListIndex - 1 or #pokemonDatas)
curPokemonData = pokemonDatas[curDataByListIndex]
if this.rightLiveObj then
poolManager:UnLoadLive(rightPokemonData.live, this.rightLiveObj)
this.rightLiveObj = nil

View File

@ -59,6 +59,10 @@ function this.GetSinglePokemonData(_did)
end
--获取所有灵兽数据
function this.GetPokemonDatas()
return pokemons
end
--获取所有灵兽数据
function this.GetPokemonResolveDatas()
local curAllPokemonList = {}
local list=this.GetAllPokemonFormationDids()
for key, value in pairs(pokemons) do

View File

@ -196,7 +196,7 @@ function this.SortTypeClick(_sortType)
selectHeroData={}
--所有灵兽数据
local items={}
local heros=PokemonManager.GetPokemonDatas()
local heros=PokemonManager.GetPokemonResolveDatas()
if heros then
for i, v in pairs(heros) do
local hero={}