灵兽涅槃提交
parent
c5b73fed7f
commit
22a2789d08
|
|
@ -147,7 +147,7 @@ RectTransform:
|
||||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||||
m_AnchorMin: {x: 0, y: 0}
|
m_AnchorMin: {x: 0, y: 0}
|
||||||
m_AnchorMax: {x: 1, y: 1}
|
m_AnchorMax: {x: 1, y: 1}
|
||||||
m_AnchoredPosition: {x: 0, y: -221.00928}
|
m_AnchoredPosition: {x: 0, y: -221.00934}
|
||||||
m_SizeDelta: {x: 0, y: -642.03}
|
m_SizeDelta: {x: 0, y: -642.03}
|
||||||
m_Pivot: {x: 0.5, y: 0.5}
|
m_Pivot: {x: 0.5, y: 0.5}
|
||||||
--- !u!222 &596642562941241991
|
--- !u!222 &596642562941241991
|
||||||
|
|
@ -372,7 +372,7 @@ RectTransform:
|
||||||
m_AnchorMin: {x: 0.5, y: 0.5}
|
m_AnchorMin: {x: 0.5, y: 0.5}
|
||||||
m_AnchorMax: {x: 0.5, y: 0.5}
|
m_AnchorMax: {x: 0.5, y: 0.5}
|
||||||
m_AnchoredPosition: {x: 0, y: 20.099945}
|
m_AnchoredPosition: {x: 0, y: 20.099945}
|
||||||
m_SizeDelta: {x: 140, y: 140}
|
m_SizeDelta: {x: 150, y: 150}
|
||||||
m_Pivot: {x: 0.5, y: 0.5}
|
m_Pivot: {x: 0.5, y: 0.5}
|
||||||
--- !u!222 &6996615424501926437
|
--- !u!222 &6996615424501926437
|
||||||
CanvasRenderer:
|
CanvasRenderer:
|
||||||
|
|
@ -396,7 +396,7 @@ MonoBehaviour:
|
||||||
m_EditorClassIdentifier:
|
m_EditorClassIdentifier:
|
||||||
m_Material: {fileID: 0}
|
m_Material: {fileID: 0}
|
||||||
m_Color: {r: 1, g: 1, b: 1, a: 1}
|
m_Color: {r: 1, g: 1, b: 1, a: 1}
|
||||||
m_RaycastTarget: 1
|
m_RaycastTarget: 0
|
||||||
m_OnCullStateChanged:
|
m_OnCullStateChanged:
|
||||||
m_PersistentCalls:
|
m_PersistentCalls:
|
||||||
m_Calls: []
|
m_Calls: []
|
||||||
|
|
@ -598,7 +598,7 @@ GameObject:
|
||||||
m_Icon: {fileID: 0}
|
m_Icon: {fileID: 0}
|
||||||
m_NavMeshLayer: 0
|
m_NavMeshLayer: 0
|
||||||
m_StaticEditorFlags: 0
|
m_StaticEditorFlags: 0
|
||||||
m_IsActive: 0
|
m_IsActive: 1
|
||||||
--- !u!224 &6630273786794472594
|
--- !u!224 &6630273786794472594
|
||||||
RectTransform:
|
RectTransform:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
|
|
@ -2440,7 +2440,7 @@ RectTransform:
|
||||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||||
m_AnchorMin: {x: 0, y: 0}
|
m_AnchorMin: {x: 0, y: 0}
|
||||||
m_AnchorMax: {x: 1, y: 1}
|
m_AnchorMax: {x: 1, y: 1}
|
||||||
m_AnchoredPosition: {x: 0, y: -221.00928}
|
m_AnchoredPosition: {x: 0, y: -221.00934}
|
||||||
m_SizeDelta: {x: 0, y: -642.03}
|
m_SizeDelta: {x: 0, y: -642.03}
|
||||||
m_Pivot: {x: 0.5, y: 0.5}
|
m_Pivot: {x: 0.5, y: 0.5}
|
||||||
--- !u!222 &1114639480647534771
|
--- !u!222 &1114639480647534771
|
||||||
|
|
@ -5497,7 +5497,7 @@ RectTransform:
|
||||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||||
m_AnchorMin: {x: 0, y: 0}
|
m_AnchorMin: {x: 0, y: 0}
|
||||||
m_AnchorMax: {x: 1, y: 1}
|
m_AnchorMax: {x: 1, y: 1}
|
||||||
m_AnchoredPosition: {x: 0, y: -221.00928}
|
m_AnchoredPosition: {x: 0, y: -221.00934}
|
||||||
m_SizeDelta: {x: 0, y: -642.03}
|
m_SizeDelta: {x: 0, y: -642.03}
|
||||||
m_Pivot: {x: 0.5, y: 0.5}
|
m_Pivot: {x: 0.5, y: 0.5}
|
||||||
--- !u!222 &5324989187067502496
|
--- !u!222 &5324989187067502496
|
||||||
|
|
@ -7490,7 +7490,7 @@ RectTransform:
|
||||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||||
m_AnchorMin: {x: 0, y: 0}
|
m_AnchorMin: {x: 0, y: 0}
|
||||||
m_AnchorMax: {x: 1, y: 1}
|
m_AnchorMax: {x: 1, y: 1}
|
||||||
m_AnchoredPosition: {x: 0, y: -221.00928}
|
m_AnchoredPosition: {x: 0, y: -221.00934}
|
||||||
m_SizeDelta: {x: 0, y: -642.03}
|
m_SizeDelta: {x: 0, y: -642.03}
|
||||||
m_Pivot: {x: 0.5, y: 0.5}
|
m_Pivot: {x: 0.5, y: 0.5}
|
||||||
--- !u!222 &636023640754060400
|
--- !u!222 &636023640754060400
|
||||||
|
|
@ -11170,7 +11170,7 @@ RectTransform:
|
||||||
m_RootOrder: 0
|
m_RootOrder: 0
|
||||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||||
m_AnchorMin: {x: 0, y: 0}
|
m_AnchorMin: {x: 0, y: 0}
|
||||||
m_AnchorMax: {x: 1, y: 1}
|
m_AnchorMax: {x: 0, y: 0}
|
||||||
m_AnchoredPosition: {x: 0, y: 0}
|
m_AnchoredPosition: {x: 0, y: 0}
|
||||||
m_SizeDelta: {x: 0, y: 0}
|
m_SizeDelta: {x: 0, y: 0}
|
||||||
m_Pivot: {x: 0.5, y: 0.5}
|
m_Pivot: {x: 0.5, y: 0.5}
|
||||||
|
|
@ -12210,7 +12210,7 @@ RectTransform:
|
||||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||||
m_AnchorMin: {x: 0.5, y: 0}
|
m_AnchorMin: {x: 0.5, y: 0}
|
||||||
m_AnchorMax: {x: 0.5, y: 0}
|
m_AnchorMax: {x: 0.5, y: 0}
|
||||||
m_AnchoredPosition: {x: 18.400003, y: -38.64038}
|
m_AnchoredPosition: {x: 18.400003, y: -38.640686}
|
||||||
m_SizeDelta: {x: 1000.3, y: 80.099976}
|
m_SizeDelta: {x: 1000.3, y: 80.099976}
|
||||||
m_Pivot: {x: 0.5, y: 0.5}
|
m_Pivot: {x: 0.5, y: 0.5}
|
||||||
--- !u!1 &7583128554718342606
|
--- !u!1 &7583128554718342606
|
||||||
|
|
@ -13467,7 +13467,7 @@ RectTransform:
|
||||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||||
m_AnchorMin: {x: 0, y: 0}
|
m_AnchorMin: {x: 0, y: 0}
|
||||||
m_AnchorMax: {x: 1, y: 1}
|
m_AnchorMax: {x: 1, y: 1}
|
||||||
m_AnchoredPosition: {x: 0, y: -221.00928}
|
m_AnchoredPosition: {x: 0, y: -221.00934}
|
||||||
m_SizeDelta: {x: 0, y: -642.03}
|
m_SizeDelta: {x: 0, y: -642.03}
|
||||||
m_Pivot: {x: 0.5, y: 0.5}
|
m_Pivot: {x: 0.5, y: 0.5}
|
||||||
--- !u!222 &4595371406642608546
|
--- !u!222 &4595371406642608546
|
||||||
|
|
|
||||||
|
|
@ -291,6 +291,22 @@ function this.GetBagItemDataByItemType(_itemType)
|
||||||
end
|
end
|
||||||
return items
|
return items
|
||||||
end
|
end
|
||||||
|
|
||||||
|
--通过物品类型获得物品list
|
||||||
|
function this.GetItemDataByItemType(_itemType)
|
||||||
|
local items = {}
|
||||||
|
local index = 1
|
||||||
|
--LogError("_itemType ".._itemType)
|
||||||
|
for i, v in pairs(this.bagDatas) do
|
||||||
|
--LogError(v.itemConfig.Name.." ".._itemType.." "..v.type.." "..v.num)
|
||||||
|
if v.type == _itemType and v.num > 0 then
|
||||||
|
items[index] = v
|
||||||
|
index = index + 1
|
||||||
|
end
|
||||||
|
end
|
||||||
|
return items
|
||||||
|
end
|
||||||
|
|
||||||
--通过物品类型获得物品list
|
--通过物品类型获得物品list
|
||||||
function this.GetDataByItemType(_itemType)
|
function this.GetDataByItemType(_itemType)
|
||||||
local items = {}
|
local items = {}
|
||||||
|
|
@ -710,10 +726,11 @@ function this.GetTableByBackDropData(drop)
|
||||||
local itemdata = {}
|
local itemdata = {}
|
||||||
itemdata.itemType = 6
|
itemdata.itemType = 6
|
||||||
itemdata.sId = drop.pokemon[i].tempId
|
itemdata.sId = drop.pokemon[i].tempId
|
||||||
itemdata.backData = drop.pokemon[i]
|
itemdata.backData = drop.pokemon[i]
|
||||||
itemdata.configData = ConfigManager.GetConfigData(ConfigName.SpiritAnimal, drop.pokemon[i].tempId)
|
itemdata.configData = ConfigManager.GetConfigData(ConfigName.SpiritAnimal, drop.pokemon[i].tempId)
|
||||||
local itemConfig = itemConfig[drop.pokemon[i].tempId]
|
local itemConfig = itemConfig[drop.pokemon[i].tempId]
|
||||||
itemdata.name = itemConfig.ReadingName
|
itemdata.name = itemConfig.ReadingName
|
||||||
|
itemdata.config=itemConfig
|
||||||
itemdata.frame = GetHeroQuantityImageByquality(itemConfig.ResourceID)
|
itemdata.frame = GetHeroQuantityImageByquality(itemConfig.ResourceID)
|
||||||
itemdata.icon ="r_jieling_fl_3008_SkillStarGem" -- GetResourcePath(itemConfig.Icon)
|
itemdata.icon ="r_jieling_fl_3008_SkillStarGem" -- GetResourcePath(itemConfig.Icon)
|
||||||
itemdata.num = 1
|
itemdata.num = 1
|
||||||
|
|
|
||||||
|
|
@ -4520,6 +4520,19 @@ function this.UpPokemonStarRequest(pokemonDId,curUpStarSelectPokemonData, func)
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
--请求灵兽涅槃
|
||||||
|
function this.PokemonBackRequest(pokemons, func)
|
||||||
|
local data = HeroInfoProto_pb.PokemonBackRequest()
|
||||||
|
data.pokemonId = pokemons
|
||||||
|
local msg = data:SerializeToString()
|
||||||
|
Network:SendMessageWithCallBack(MessageTypeProto_pb.POKEMON_BACK_REQUEST, MessageTypeProto_pb.POKEMON_BACK_RESPONSE, msg, function(buffer)
|
||||||
|
-- local data = buffer:DataByte()
|
||||||
|
-- msg:ParseFromString(data)
|
||||||
|
if func then
|
||||||
|
func(msg)
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
end
|
||||||
--替换灵兽编队
|
--替换灵兽编队
|
||||||
function this.ReplaceTeamPokemonInfoRequest(_teamPokemonInfos, func)
|
function this.ReplaceTeamPokemonInfoRequest(_teamPokemonInfos, func)
|
||||||
local data = HeroInfoProto_pb.ReplaceTeamPokemonInfoRequest()
|
local data = HeroInfoProto_pb.ReplaceTeamPokemonInfoRequest()
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,6 @@ 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 spiritConfig=ConfigManager.GetConfig(ConfigName.SpiritAnimalSetting)
|
|
||||||
local index--当前灵兽在 灵兽列表中的索引
|
local index--当前灵兽在 灵兽列表中的索引
|
||||||
local allAddProVal={}--所有属性加成值
|
local allAddProVal={}--所有属性加成值
|
||||||
local isClickLeftOrRightBtn = true--点击左右按钮切换灵兽播放动画状态
|
local isClickLeftOrRightBtn = true--点击左右按钮切换灵兽播放动画状态
|
||||||
|
|
@ -94,11 +93,11 @@ function PokemonInfoPanel:BindEvent()
|
||||||
Util.AddClick(this.nirvanaBtn, function()
|
Util.AddClick(this.nirvanaBtn, function()
|
||||||
local lv=curPokemonData.lv
|
local lv=curPokemonData.lv
|
||||||
local star=curPokemonData.star
|
local star=curPokemonData.star
|
||||||
local qua=curPokemonData.Quality
|
local qua=curPokemonData.config.Quality
|
||||||
--所有材料
|
--所有材料
|
||||||
local allMaterials={}
|
local allMaterials={}
|
||||||
--升级消耗
|
--升级消耗
|
||||||
local lvConfig=ConfigManager.GetConfigDataByDoubleKey(ConfigName.SpiritAnimalLevel,"Level",lv,"Quality",star)
|
local lvConfig=ConfigManager.GetConfigDataByDoubleKey(ConfigName.SpiritAnimalLevel,"Level",lv,"Quality",qua)
|
||||||
if lvConfig then
|
if lvConfig then
|
||||||
local matrs=lvConfig.SumConsume
|
local matrs=lvConfig.SumConsume
|
||||||
if matrs then
|
if matrs then
|
||||||
|
|
@ -109,36 +108,40 @@ function PokemonInfoPanel:BindEvent()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
--升星消耗
|
--升星消耗
|
||||||
local starConfig=ConfigManager.GetAllConfigsDataByDoubleKey(ConfigName.SpiritAnimalStar,"Star",star,"Quality",qua)
|
local lingshouConfig=ConfigManager.GetConfigData(ConfigName.SpiritAnimal,curPokemonData.id)
|
||||||
if starConfig then
|
if star>0 then
|
||||||
--消耗本体数量,分解成碎片
|
local starConfig=ConfigManager.GetAllConfigsDataByDoubleKey(ConfigName.SpiritAnimalStar,"Star",star,"Quality",qua)
|
||||||
local lingshouConfig=ConfigManager.GetConfigData(ConfigName.SpiritAnimal,curPokemonData.id)
|
if starConfig then
|
||||||
if starConfig.ConsumeItemNum>0 then
|
--消耗本体数量,分解成碎片
|
||||||
local chipNum=lingshouConfig.PiecesCount*(1+starConfig.ConsumeItemNum)
|
if starConfig.ConsumeItemNum>0 then
|
||||||
table.insert(allMaterials,{lingshouConfig.PiecesId,chipNum})
|
local chipNum=lingshouConfig.PiecesCount*(1+starConfig.ConsumeItemNum)
|
||||||
end
|
table.insert(allMaterials,{lingshouConfig.PiecesId,chipNum})
|
||||||
local starMatrs=starConfig.SumConsume
|
end
|
||||||
--消耗材料
|
local starMatrs=starConfig.SumConsume
|
||||||
if starMatrs then
|
--消耗材料
|
||||||
for i = 1, #starMatrs do
|
if starMatrs then
|
||||||
local starm=starMatrs[i]
|
for i = 1, #starMatrs do
|
||||||
table.insert(allMaterials,{starm[1],starm[2]})
|
local starm=starMatrs[i]
|
||||||
|
table.insert(allMaterials,{starm[1],starm[2]})
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
local coin=0
|
local coin=0
|
||||||
--消耗妖晶的数量
|
--消耗妖晶的数量
|
||||||
if spiritConfig then
|
if lingshouConfig.ReturnCos then
|
||||||
coin=spiritConfig.ReturnCost
|
coin=lingshouConfig.ReturnCost[1][2]
|
||||||
|
LogError("消耗妖晶数量"..coin)
|
||||||
end
|
end
|
||||||
--判断妖晶是否充足
|
--判断妖晶是否充足
|
||||||
if coin<BagManager.GetItemCountById(16) then
|
if coin>BagManager.GetItemCountById(16) then
|
||||||
PopupTipPanel.ShowTip(Language[11139])
|
PopupTipPanel.ShowTip(Language[11139])
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
UIManager.OpenPanel(UIName.GeneralPopup,GENERAL_POPUP_TYPE.PokemonResolve,coin,allMaterials,function ()
|
UIManager.OpenPanel(UIName.GeneralPopup,GENERAL_POPUP_TYPE.PokemonResolve,coin,allMaterials,function ()
|
||||||
NetManager.ComplexEquipRequest(curIndex,0,0,function(msg)
|
NetManager.PokemonBackRequest(curPokemonData.dynamicId,function(msg)
|
||||||
this.OnClickTabBtn(curIndex)
|
-- this.OnClickTabBtn(curIndex)
|
||||||
UIManager.OpenPanel(UIName.RewardItemPopup,msg.drop,1,function()
|
UIManager.OpenPanel(UIName.RewardItemPopup,msg.drop,1,function()
|
||||||
end)
|
end)
|
||||||
end)
|
end)
|
||||||
|
|
|
||||||
|
|
@ -40,6 +40,7 @@ function this.UpdatePokemonDatas(_msgPokemonData,isRefreshFetter)--单个掉落
|
||||||
singPokemonData.scale = spiritAnimal[singPokemonData.id].Scale
|
singPokemonData.scale = spiritAnimal[singPokemonData.id].Scale
|
||||||
singPokemonData.position = spiritAnimal[singPokemonData.id].Position
|
singPokemonData.position = spiritAnimal[singPokemonData.id].Position
|
||||||
singPokemonData.config= spiritAnimal[_msgPokemonData.tempId]
|
singPokemonData.config= spiritAnimal[_msgPokemonData.tempId]
|
||||||
|
|
||||||
pokemons[singPokemonData.dynamicId] = singPokemonData
|
pokemons[singPokemonData.dynamicId] = singPokemonData
|
||||||
if isRefreshFetter then
|
if isRefreshFetter then
|
||||||
this.GetPokemonRefreshFetter(singPokemonData.id)
|
this.GetPokemonRefreshFetter(singPokemonData.id)
|
||||||
|
|
@ -58,7 +59,9 @@ end
|
||||||
function this.GetPokemonDatas()
|
function this.GetPokemonDatas()
|
||||||
local curAllPokemonList = {}
|
local curAllPokemonList = {}
|
||||||
for key, value in pairs(pokemons) do
|
for key, value in pairs(pokemons) do
|
||||||
table.insert(curAllPokemonList,value)
|
if not value.isZhen then
|
||||||
|
table.insert(curAllPokemonList,value)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
return curAllPokemonList
|
return curAllPokemonList
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -51,9 +51,9 @@ local contentScripts = {
|
||||||
--灵兽战力加成
|
--灵兽战力加成
|
||||||
[24] = {view = require("Modules/Popup/View/GeneralPopup_PokemonUpZhenAddPro"), panelName = "GeneralPopup_PokemonUpZhenAddPro",type=GENERAL_POPUP_TYPE.PokemonUpZhenAddPro},
|
[24] = {view = require("Modules/Popup/View/GeneralPopup_PokemonUpZhenAddPro"), panelName = "GeneralPopup_PokemonUpZhenAddPro",type=GENERAL_POPUP_TYPE.PokemonUpZhenAddPro},
|
||||||
--灵兽涅槃
|
--灵兽涅槃
|
||||||
[25]={view = require("Modules/Popup/View/GeneralPopup_PokemonResolve"), panelName = "GeneralPopup_PokemonResolve",type=GENERAL_POPUP_TYPE.PokemonResolve},
|
[25] = {view = require("Modules/Popup/View/GeneralPopup_PokemonResolve"), panelName = "GeneralPopup_PokemonResolve",type=GENERAL_POPUP_TYPE.PokemonResolve},
|
||||||
--灵兽还原
|
--灵兽还原
|
||||||
[26]={view = require("Modules/Popup/View/GeneralPopup_PokemonRestore"), panelName = "GeneralPopup_PokemonRestore",type=GENERAL_POPUP_TYPE.PokemonResolve},
|
[26] = {view = require("Modules/Popup/View/GeneralPopup_PokemonRestore"), panelName = "GeneralPopup_PokemonRestore",type=GENERAL_POPUP_TYPE.PokemonRestore},
|
||||||
--灵兽碎片合成
|
--灵兽碎片合成
|
||||||
[27]={view = require("Modules/Popup/View/GeneralPopup_PokemonChipCompound"), panelName = "GeneralPopup_PokemonChipCompound",type=GENERAL_POPUP_TYPE.PokemonCompound},
|
[27]={view = require("Modules/Popup/View/GeneralPopup_PokemonChipCompound"), panelName = "GeneralPopup_PokemonChipCompound",type=GENERAL_POPUP_TYPE.PokemonCompound},
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,7 @@ function this:InitComponent(gameObject)
|
||||||
this.titleText.text="灵兽涅槃"
|
this.titleText.text="灵兽涅槃"
|
||||||
this.infoTxt=Util.GetGameObject(gameObject,"Body/Text"):GetComponent("Text")
|
this.infoTxt=Util.GetGameObject(gameObject,"Body/Text"):GetComponent("Text")
|
||||||
--this.num=Util.GetGameObject(gameObject,"Body/Num"):GetComponent("Text")
|
--this.num=Util.GetGameObject(gameObject,"Body/Num"):GetComponent("Text")
|
||||||
-- this.numImage=Util.GetGameObject(gameObject,"Body/Num/Image"):GetComponent("Image")
|
this.numImage=Util.GetGameObject(gameObject,"Body/Image"):GetComponent("Image")
|
||||||
this.cancelBtn=Util.GetGameObject(gameObject,"CancelBtn")
|
this.cancelBtn=Util.GetGameObject(gameObject,"CancelBtn")
|
||||||
this.confirmBtn=Util.GetGameObject(gameObject,"ConfirmBtn")
|
this.confirmBtn=Util.GetGameObject(gameObject,"ConfirmBtn")
|
||||||
Util.GetGameObject(gameObject,"ConfirmBtn/Text"):GetComponent("Text").text="涅槃"
|
Util.GetGameObject(gameObject,"ConfirmBtn/Text"):GetComponent("Text").text="涅槃"
|
||||||
|
|
@ -47,10 +47,10 @@ function this:OnShow(_parent,...)
|
||||||
sortingOrder = _parent.sortingOrder
|
sortingOrder = _parent.sortingOrder
|
||||||
--不定参中包含的不定参 _args[1]为面板类型 _args[2]之后(包括)为打开面板后传入的不定参
|
--不定参中包含的不定参 _args[1]为面板类型 _args[2]之后(包括)为打开面板后传入的不定参
|
||||||
local args = {...}
|
local args = {...}
|
||||||
this.num.text = args[1]
|
--this.num.text = args[1]
|
||||||
|
itemList=args[2]
|
||||||
fun = args[3]
|
fun = args[3]
|
||||||
this.titleText.text=Language[11617]
|
this.infoTxt.text=string.format("确认花费 %s将%s涅槃为<color=#55C78AFF>灵兽碎片</color>,并<color=#55C78AFF>100返还</color>养成消耗",args[1],"111")
|
||||||
this.infoTxt.text=string.format("确认花费 %s将%s涅槃为<color=#55C78AFF>灵兽碎片</color>,并<color=#55C78AFF>100%返还</color>养成消耗")
|
|
||||||
this.numImage.sprite = SetIcon(14)
|
this.numImage.sprite = SetIcon(14)
|
||||||
FindFairyManager.ResetItemView(this.root,this.root.transform,itemList,10,1,sortingOrder,false,args[2])
|
FindFairyManager.ResetItemView(this.root,this.root.transform,itemList,10,1,sortingOrder,false,args[2])
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,9 @@ local dropList = {}
|
||||||
--item容器
|
--item容器
|
||||||
local itemList = {}
|
local itemList = {}
|
||||||
--传入选择英雄
|
--传入选择英雄
|
||||||
local selectHeroData
|
local selectHeroData={}
|
||||||
|
local chipId=0
|
||||||
|
local chipNum=0
|
||||||
local heroConfig=ConfigManager.GetConfig(ConfigName.HeroConfig)
|
local heroConfig=ConfigManager.GetConfig(ConfigName.HeroConfig)
|
||||||
local itemConfig=ConfigManager.GetConfig(ConfigName.ItemConfig)
|
local itemConfig=ConfigManager.GetConfig(ConfigName.ItemConfig)
|
||||||
|
|
||||||
|
|
@ -56,8 +58,9 @@ function this:OnShow(_parent,...)
|
||||||
parent=_parent
|
parent=_parent
|
||||||
sortingOrder =_parent.sortingOrder
|
sortingOrder =_parent.sortingOrder
|
||||||
local args = {...}
|
local args = {...}
|
||||||
dropList = args[1]
|
selectHeroData=args[1]
|
||||||
selectHeroData=args[2]
|
chipId=args[2]
|
||||||
|
chipNum=args[3]
|
||||||
local isShowFourStarUpTip = false
|
local isShowFourStarUpTip = false
|
||||||
for k,v in pairs(selectHeroData) do
|
for k,v in pairs(selectHeroData) do
|
||||||
if v.star >= 4 then
|
if v.star >= 4 then
|
||||||
|
|
|
||||||
|
|
@ -7,14 +7,15 @@ local selectHeroData={}--选择的英雄list did = data
|
||||||
local maxSelectNum = 30--最大选择数量
|
local maxSelectNum = 30--最大选择数量
|
||||||
--选择碎片的数量
|
--选择碎片的数量
|
||||||
local selectChipNum = 0
|
local selectChipNum = 0
|
||||||
|
--显示的灵兽及碎片数据
|
||||||
|
local heroDatas={}
|
||||||
local oldChoosed=nil--上一个选中英雄
|
local oldChoosed=nil--上一个选中英雄
|
||||||
--选择的碎片id
|
--选择的碎片id
|
||||||
local selectChipId=0
|
local selectChipId=0
|
||||||
--碎片最大数量
|
--碎片最大数量
|
||||||
local maxChipNum =0
|
local maxChipNum =0
|
||||||
--是否为灵兽/灵兽碎片
|
--是否为灵兽/灵兽碎片
|
||||||
local isPokemon = true
|
local isPokemon = false
|
||||||
function this:InitComponent(gameObject)
|
function this:InitComponent(gameObject)
|
||||||
--上部内容
|
--上部内容
|
||||||
this.helpBtn=Util.GetGameObject(gameObject,"Content/Resolve_Pokemon/HelpBtn")
|
this.helpBtn=Util.GetGameObject(gameObject,"Content/Resolve_Pokemon/HelpBtn")
|
||||||
|
|
@ -33,7 +34,7 @@ function this:InitComponent(gameObject)
|
||||||
this.chipObj=Util.GetGameObject(gameObject, "Content/Resolve_Pokemon/chipObj")
|
this.chipObj=Util.GetGameObject(gameObject, "Content/Resolve_Pokemon/chipObj")
|
||||||
this.btn_remove=Util.GetGameObject(gameObject, "Content/Resolve_Pokemon/chipObj/btn_remove")
|
this.btn_remove=Util.GetGameObject(gameObject, "Content/Resolve_Pokemon/chipObj/btn_remove")
|
||||||
this.btn_add=Util.GetGameObject(gameObject, "Content/Resolve_Pokemon/chipObj/btn_add")
|
this.btn_add=Util.GetGameObject(gameObject, "Content/Resolve_Pokemon/chipObj/btn_add")
|
||||||
this.chipNumTxt=Util.GetGameObject(gameObject, "Content/Resolve_Pokemon/chipObj/Text")
|
this.chipNumTxt=Util.GetGameObject(gameObject, "Content/Resolve_Pokemon/chipObj/Text"):GetComponent("Text")
|
||||||
|
|
||||||
this.ScrollView = SubUIManager.Open(SubUIConfig.ScrollCycleView, Util.GetGameObject(gameObject, "Content/Resolve_Pokemon/ItemListRoot").transform,
|
this.ScrollView = SubUIManager.Open(SubUIConfig.ScrollCycleView, Util.GetGameObject(gameObject, "Content/Resolve_Pokemon/ItemListRoot").transform,
|
||||||
this.cardPre, this.scrollbar, Vector2.New(v21.width, v21.height), 1, 5, Vector2.New(43,15))
|
this.cardPre, this.scrollbar, Vector2.New(v21.width, v21.height), 1, 5, Vector2.New(43,15))
|
||||||
|
|
@ -81,7 +82,7 @@ function this:BindEvent()
|
||||||
PopupTipPanel.ShowTip(Language[12394])
|
PopupTipPanel.ShowTip(Language[12394])
|
||||||
else
|
else
|
||||||
UIManager.OpenPanel(UIName.GeneralPopup,GENERAL_POPUP_TYPE.ResolveDismantle,
|
UIManager.OpenPanel(UIName.GeneralPopup,GENERAL_POPUP_TYPE.ResolveDismantle,
|
||||||
HeroManager.GetHeroReturnItems(selectHeroData,GENERAL_POPUP_TYPE.ResolveDismantle),selectHeroData)
|
HeroManager.GetHeroReturnItems(selectHeroData,GENERAL_POPUP_TYPE.ResolveDismantle),selectHeroData,selectChipId,selectChipNum)
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
|
@ -113,8 +114,6 @@ function this.SortTypeClick(_sortType)
|
||||||
--所有灵兽数据
|
--所有灵兽数据
|
||||||
|
|
||||||
local heros=PokemonManager.GetPokemonDatas()
|
local heros=PokemonManager.GetPokemonDatas()
|
||||||
local heroDatas={}
|
|
||||||
local chipDatas={}
|
|
||||||
if heros then
|
if heros then
|
||||||
for i, v in pairs(heros) do
|
for i, v in pairs(heros) do
|
||||||
local hero={}
|
local hero={}
|
||||||
|
|
@ -122,20 +121,20 @@ function this.SortTypeClick(_sortType)
|
||||||
hero.star=v.star
|
hero.star=v.star
|
||||||
hero.lv=v.lv
|
hero.lv=v.lv
|
||||||
hero.dynamicId=v.dynamicId
|
hero.dynamicId=v.dynamicId
|
||||||
hero.ischip=0
|
hero.ischip=0
|
||||||
hero.frame= GetHeroQuantityImageByquality(heroConfig.Quality,v.star)
|
|
||||||
hero.icon=heroConfig.Icon
|
hero.icon=heroConfig.Icon
|
||||||
hero.id=v.id
|
hero.id=v.id
|
||||||
hero.quality=heroConfig.Quality
|
hero.quality=heroConfig.Quality
|
||||||
hero.name=heroConfig.Name
|
hero.name=heroConfig.Name
|
||||||
hero.returnCoin=heroConfig.CoinReturn
|
hero.returnCoin=heroConfig.CoinReturn
|
||||||
|
hero.frame=GetHeroQuantityImageByquality(heroConfig.Quality,1)
|
||||||
hero.num=1
|
hero.num=1
|
||||||
table.insert(heroDatas,hero)
|
table.insert(heroDatas,hero)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
--所有灵兽碎片
|
--所有灵兽碎片
|
||||||
local chips=BagManager.GetBagItemDataByItemType(22)
|
local chips=BagManager.GetDataByItemType(22)
|
||||||
if chips then
|
if chips then
|
||||||
for i, v in pairs(chips) do
|
for i, v in pairs(chips) do
|
||||||
local chip={}
|
local chip={}
|
||||||
|
|
@ -149,16 +148,18 @@ function this.SortTypeClick(_sortType)
|
||||||
chip.num=v.num
|
chip.num=v.num
|
||||||
chip.name=v.name
|
chip.name=v.name
|
||||||
chip.returnCoin=0
|
chip.returnCoin=0
|
||||||
|
chip.dynamicId=v.id
|
||||||
table.insert(heroDatas,chip)
|
table.insert(heroDatas,chip)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
this.chipObj:SetActive(false)
|
||||||
|
this.selectText.gameObject:SetActive(true)
|
||||||
this.selectText.text = Language[11775].."0/"..maxSelectNum
|
this.selectText.text = Language[11775].."0/"..maxSelectNum
|
||||||
-- this.SortHeroDatas(heroDatas)
|
-- this.SortHeroDatas(heroDatas)
|
||||||
this.Empty:SetActive(#heroDatas <= 0)
|
this.Empty:SetActive(#heroDatas <= 0)
|
||||||
this.ScrollView:SetData(heroDatas, function (index, go)
|
this.ScrollView:SetData(heroDatas, function (index, go)
|
||||||
this.SingleHeroDataShow(go, heroDatas[index])
|
this.SingleHeroDataShow(go, heroDatas[index],false)
|
||||||
end)
|
end)
|
||||||
this.ScrollView:ForeachItemGO(function(index, go)
|
this.ScrollView:ForeachItemGO(function(index, go)
|
||||||
Timer.New(function()
|
Timer.New(function()
|
||||||
|
|
@ -169,25 +170,31 @@ function this.SortTypeClick(_sortType)
|
||||||
end
|
end
|
||||||
|
|
||||||
--英雄单个数据展示
|
--英雄单个数据展示
|
||||||
function this.SingleHeroDataShow(go,_heroData)
|
function this.SingleHeroDataShow(go,_heroData,isGray)
|
||||||
local heroData = _heroData
|
local heroData = _heroData
|
||||||
local _go = go
|
local _go = go
|
||||||
Util.GetGameObject(_go.transform, "frame"):GetComponent("Image").sprite = Util.LoadSprite(heroData.frame)
|
Util.GetGameObject(_go.transform, "frame"):GetComponent("Image").sprite = Util.LoadSprite(heroData.frame)
|
||||||
Util.GetGameObject(_go.transform, "lv/Text"):GetComponent("Text").text = heroData.lv
|
if heroData.ischip==1 then
|
||||||
|
Util.GetGameObject(_go.transform, "lv/Text"):GetComponent("Text").text = heroData.num
|
||||||
|
else
|
||||||
|
Util.GetGameObject(_go.transform, "lv/Text"):GetComponent("Text").text = heroData.lv
|
||||||
|
end
|
||||||
|
|
||||||
Util.GetGameObject(_go.transform, "Text"):GetComponent("Text").text = heroData.name
|
Util.GetGameObject(_go.transform, "Text"):GetComponent("Text").text = heroData.name
|
||||||
Util.GetGameObject(_go.transform, "icon"):GetComponent("Image").sprite = Util.LoadSprite(heroData.icon)
|
Util.GetGameObject(_go.transform, "icon"):GetComponent("Image").sprite = Util.LoadSprite(heroData.icon)
|
||||||
local chipImg=Util.GetGameObject(_go.transform, "chipImg"):GetComponent("Image")
|
local chipImg=Util.GetGameObject(_go.transform, "chipImg"):GetComponent("Image")
|
||||||
|
local formationMask =Util.GetGameObject(_go.transform, "mask")
|
||||||
if heroData.ischip==1 then
|
if heroData.ischip==1 then
|
||||||
chipImg.gameObject:SetActive(true)
|
chipImg.gameObject:SetActive(true)
|
||||||
|
formationMask:SetActive(isGray)
|
||||||
chipImg.sprite=Util.LoadSprite(GetHeroChipQuantityImageByquality(heroData.quality))
|
chipImg.sprite=Util.LoadSprite(GetHeroChipQuantityImageByquality(heroData.quality))
|
||||||
else
|
else
|
||||||
chipImg.gameObject:SetActive(false)
|
chipImg.gameObject:SetActive(false)
|
||||||
|
formationMask:SetActive(false)
|
||||||
end
|
end
|
||||||
local starGrid = Util.GetGameObject(_go.transform, "star")
|
local starGrid = Util.GetGameObject(_go.transform, "star")
|
||||||
SetHeroStars(starGrid, heroData.star,1,Vector2.New(32.5,32.5),-15)
|
SetHeroStars(starGrid, heroData.star,1,Vector2.New(32.5,32.5),-15)
|
||||||
local choosed =Util.GetGameObject(_go.transform, "choosed")
|
local choosed =Util.GetGameObject(_go.transform, "choosed")
|
||||||
local formationMask =Util.GetGameObject(_go.transform, "mask")
|
|
||||||
formationMask:SetActive(not isPokemon)
|
|
||||||
if heroData.ischip then
|
if heroData.ischip then
|
||||||
choosed:SetActive(selectChipId==heroData.dynamicId)
|
choosed:SetActive(selectChipId==heroData.dynamicId)
|
||||||
else
|
else
|
||||||
|
|
@ -197,11 +204,12 @@ function this.SingleHeroDataShow(go,_heroData)
|
||||||
this.selectText.text = Language[11775]..LengthOfTable(selectHeroData).."/"..maxSelectNum
|
this.selectText.text = Language[11775]..LengthOfTable(selectHeroData).."/"..maxSelectNum
|
||||||
Util.AddOnceClick(cardclickBtn, function()
|
Util.AddOnceClick(cardclickBtn, function()
|
||||||
--如果点击的是碎片
|
--如果点击的是碎片
|
||||||
if heroData.ischip then
|
if heroData.ischip==1 then
|
||||||
--第一个选中的碎片
|
--第一个选中的碎片
|
||||||
if oldChoosed==nil then
|
if oldChoosed==nil then
|
||||||
this.selectText:SetActive(false)
|
this.selectText.gameObject:SetActive(false)
|
||||||
this.chipObj:SetActive(true)
|
this.chipObj:SetActive(true)
|
||||||
|
choosed:SetActive(true)
|
||||||
oldChoosed=choosed
|
oldChoosed=choosed
|
||||||
else
|
else
|
||||||
--如果选中之前选中的,就取消选中
|
--如果选中之前选中的,就取消选中
|
||||||
|
|
@ -209,32 +217,40 @@ function this.SingleHeroDataShow(go,_heroData)
|
||||||
oldChoosed=nil
|
oldChoosed=nil
|
||||||
selectChipId=0
|
selectChipId=0
|
||||||
choosed:SetActive(false)
|
choosed:SetActive(false)
|
||||||
this.selectText:SetActive(true)
|
this.selectText.gameObject:SetActive(true)
|
||||||
this.selectText.text = Language[11775].."0".."/"..maxSelectNum
|
this.selectText.text = Language[11775].."0".."/"..maxSelectNum
|
||||||
this.chipObj:SetActive(false)
|
this.chipObj:SetActive(false)
|
||||||
return
|
return
|
||||||
else
|
else
|
||||||
oldChoosed:SetActive(false)
|
oldChoosed:SetActive(false)
|
||||||
|
choosed:SetActive(true)
|
||||||
oldChoosed=choosed
|
oldChoosed=choosed
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
selectChipId=heroData.dynamicId
|
selectChipId=heroData.dynamicId
|
||||||
Util.SetGray(this.btn_add,true)
|
Util.SetGray(this.btn_add,true)
|
||||||
selectChipNum=heroData.chipNum
|
selectChipNum=heroData.num
|
||||||
maxChipNum=heroData.chipNum
|
maxChipNum=heroData.num
|
||||||
this.chipNumTxt.text=selectChipNum
|
this.chipNumTxt.text=selectChipNum
|
||||||
isPokemon=false
|
isPokemon=false
|
||||||
|
|
||||||
--点击的是灵兽
|
--点击的是灵兽
|
||||||
else
|
else
|
||||||
--如果灵兽是选中状态,取消选中
|
--如果灵兽是选中状态,取消选中
|
||||||
if selectHeroData[heroData.dynamicId] then
|
if selectHeroData[heroData.dynamicId] then
|
||||||
choosed:SetActive(false)
|
choosed:SetActive(false)
|
||||||
|
if oldChoosed then
|
||||||
|
oldChoosed:SetActive(false)
|
||||||
|
end
|
||||||
|
selectChipId=0
|
||||||
selectHeroData[heroData.dynamicId] = nil
|
selectHeroData[heroData.dynamicId] = nil
|
||||||
local haveNum=LengthOfTable(selectHeroData)
|
local haveNum=LengthOfTable(selectHeroData)
|
||||||
this.selectText.text = Language[11775]..haveNum.."/"..maxSelectNum
|
this.selectText.text = Language[11775]..haveNum.."/"..maxSelectNum
|
||||||
if haveNum==0 then
|
if haveNum==0 then
|
||||||
-- --todo 取消所有碎片置灰
|
-- --todo 取消所有碎片置灰
|
||||||
|
this.ScrollView:SetData(heroDatas, function (index, go)
|
||||||
|
this.SingleHeroDataShow(go, heroDatas[index],false)
|
||||||
|
end)
|
||||||
|
isPokemon=false
|
||||||
end
|
end
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
@ -245,8 +261,11 @@ function this.SingleHeroDataShow(go,_heroData)
|
||||||
end
|
end
|
||||||
if isPokemon==false then
|
if isPokemon==false then
|
||||||
--todo 首次点击灵兽,置灰所有碎片
|
--todo 首次点击灵兽,置灰所有碎片
|
||||||
|
this.ScrollView:SetData(heroDatas, function (index, go)
|
||||||
|
this.SingleHeroDataShow(go, heroDatas[index],true)
|
||||||
|
end)
|
||||||
selectChipId=0
|
selectChipId=0
|
||||||
this.selectText:SetActive(true)
|
this.selectText.gameObject:SetActive(true)
|
||||||
this.chipObj:SetActive(false)
|
this.chipObj:SetActive(false)
|
||||||
isPokemon = true
|
isPokemon = true
|
||||||
end
|
end
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue