灵兽修改提交
parent
aff128d50a
commit
3fa9583f56
|
|
@ -11,7 +11,7 @@ local pokemonDatas--所有灵兽list信息
|
||||||
local itemConfig = ConfigManager.GetConfig(ConfigName.ItemConfig)
|
local itemConfig = ConfigManager.GetConfig(ConfigName.ItemConfig)
|
||||||
local heroRankupConfig = ConfigManager.GetConfig(ConfigName.HeroRankupConfig)
|
local heroRankupConfig = ConfigManager.GetConfig(ConfigName.HeroRankupConfig)
|
||||||
local propertyConfig = ConfigManager.GetConfig(ConfigName.PropertyConfig)
|
local propertyConfig = ConfigManager.GetConfig(ConfigName.PropertyConfig)
|
||||||
local index--当前灵兽在 灵兽列表中的索引
|
local curDataByListIndex--当前灵兽在 灵兽列表中的索引
|
||||||
local allAddProVal={}--所有属性加成值
|
local allAddProVal={}--所有属性加成值
|
||||||
local isClickLeftOrRightBtn = true--点击左右按钮切换灵兽播放动画状态
|
local isClickLeftOrRightBtn = true--点击左右按钮切换灵兽播放动画状态
|
||||||
local upZhenDidis
|
local upZhenDidis
|
||||||
|
|
@ -251,8 +251,8 @@ end
|
||||||
function this.OnShowData()
|
function this.OnShowData()
|
||||||
isClickLeftOrRightBtn = true
|
isClickLeftOrRightBtn = true
|
||||||
for i = 1, #pokemonDatas do
|
for i = 1, #pokemonDatas do
|
||||||
if curPokemonData == pokemonDatas[i] then
|
if curPokemonData.dynamicId == pokemonDatas[i].dynamicId then
|
||||||
index = i
|
curDataByListIndex = i
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
this.UpdateLiveList()--加载当前 和 左右数据
|
this.UpdateLiveList()--加载当前 和 左右数据
|
||||||
|
|
@ -297,10 +297,10 @@ end
|
||||||
|
|
||||||
--更新界面已存数据
|
--更新界面已存数据
|
||||||
function this.UpdateLiveList()
|
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]
|
leftPokemonData = pokemonDatas[leftIndex]
|
||||||
curPokemonData = pokemonDatas[index]
|
curPokemonData = pokemonDatas[curDataByListIndex]
|
||||||
local rightIndex = (index + 1 <= #pokemonDatas and index + 1 or 1)
|
local rightIndex = (curDataByListIndex + 1 <= #pokemonDatas and curDataByListIndex + 1 or 1)
|
||||||
rightPokemonData = pokemonDatas[rightIndex]
|
rightPokemonData = pokemonDatas[rightIndex]
|
||||||
-- LogPink(leftIndex.." "..index.." "..rightIndex)
|
-- LogPink(leftIndex.." "..index.." "..rightIndex)
|
||||||
end
|
end
|
||||||
|
|
@ -346,9 +346,9 @@ function this.RightBtnOnClick()
|
||||||
end
|
end
|
||||||
isClickLeftOrRightBtn = false
|
isClickLeftOrRightBtn = false
|
||||||
this.rightBtn:GetComponent("Button").enabled = false
|
this.rightBtn:GetComponent("Button").enabled = false
|
||||||
local oldIndexConfigData = pokemonDatas[index]
|
local oldIndexConfigData = pokemonDatas[curDataByListIndex]
|
||||||
index = (index + 1 <= #pokemonDatas and index + 1 or 1)
|
curDataByListIndex = (curDataByListIndex + 1 <= #pokemonDatas and curDataByListIndex + 1 or 1)
|
||||||
curPokemonData = pokemonDatas[index]
|
curPokemonData = pokemonDatas[curDataByListIndex]
|
||||||
if this.leftLiveObj then
|
if this.leftLiveObj then
|
||||||
poolManager:UnLoadLive(leftPokemonData.live, this.leftLiveObj)
|
poolManager:UnLoadLive(leftPokemonData.live, this.leftLiveObj)
|
||||||
this.leftLiveObj = nil
|
this.leftLiveObj = nil
|
||||||
|
|
@ -376,9 +376,9 @@ function this.LeftBtnOnClick()
|
||||||
end
|
end
|
||||||
isClickLeftOrRightBtn = false
|
isClickLeftOrRightBtn = false
|
||||||
this.leftBtn:GetComponent("Button").enabled = false
|
this.leftBtn:GetComponent("Button").enabled = false
|
||||||
local oldIndexConfigData = pokemonDatas[index]
|
local oldIndexConfigData = pokemonDatas[curDataByListIndex]
|
||||||
index = (index - 1 > 0 and index - 1 or #pokemonDatas)
|
curDataByListIndex = (curDataByListIndex - 1 > 0 and curDataByListIndex - 1 or #pokemonDatas)
|
||||||
curPokemonData = pokemonDatas[index]
|
curPokemonData = pokemonDatas[curDataByListIndex]
|
||||||
if this.rightLiveObj then
|
if this.rightLiveObj then
|
||||||
poolManager:UnLoadLive(rightPokemonData.live, this.rightLiveObj)
|
poolManager:UnLoadLive(rightPokemonData.live, this.rightLiveObj)
|
||||||
this.rightLiveObj = nil
|
this.rightLiveObj = nil
|
||||||
|
|
|
||||||
|
|
@ -59,6 +59,10 @@ function this.GetSinglePokemonData(_did)
|
||||||
end
|
end
|
||||||
--获取所有灵兽数据
|
--获取所有灵兽数据
|
||||||
function this.GetPokemonDatas()
|
function this.GetPokemonDatas()
|
||||||
|
return pokemons
|
||||||
|
end
|
||||||
|
--获取所有灵兽数据
|
||||||
|
function this.GetPokemonResolveDatas()
|
||||||
local curAllPokemonList = {}
|
local curAllPokemonList = {}
|
||||||
local list=this.GetAllPokemonFormationDids()
|
local list=this.GetAllPokemonFormationDids()
|
||||||
for key, value in pairs(pokemons) do
|
for key, value in pairs(pokemons) do
|
||||||
|
|
|
||||||
|
|
@ -196,7 +196,7 @@ function this.SortTypeClick(_sortType)
|
||||||
selectHeroData={}
|
selectHeroData={}
|
||||||
--所有灵兽数据
|
--所有灵兽数据
|
||||||
local items={}
|
local items={}
|
||||||
local heros=PokemonManager.GetPokemonDatas()
|
local heros=PokemonManager.GetPokemonResolveDatas()
|
||||||
if heros then
|
if heros then
|
||||||
for i, v in pairs(heros) do
|
for i, v in pairs(heros) do
|
||||||
local hero={}
|
local hero={}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue