神兵更换代码提交
parent
a176bca619
commit
6c5acdab26
|
@ -44,21 +44,25 @@ end
|
||||||
|
|
||||||
--添加事件监听(用于子类重写)
|
--添加事件监听(用于子类重写)
|
||||||
function this:AddListener()
|
function this:AddListener()
|
||||||
-- Game.GlobalEvent:AddEvent(GameEvent.GodWeapon.RefreshGodWeaponInfoPanel, this.ShowPower)
|
Game.GlobalEvent:AddEvent(GameEvent.GodWeapon.RefreshGodWeaponInfoPanel, this.UpdateWin)
|
||||||
end
|
end
|
||||||
|
|
||||||
--移除事件监听(用于子类重写)
|
--移除事件监听(用于子类重写)
|
||||||
function this:RemoveListener()
|
function this:RemoveListener()
|
||||||
|
Game.GlobalEvent:RemoveEvent(GameEvent.GodWeapon.RefreshGodWeaponInfoPanel, this.UpdateWin)
|
||||||
end
|
end
|
||||||
|
|
||||||
--界面打开时调用(用于子类重写)
|
--界面打开时调用(用于子类重写)
|
||||||
function this:OnOpen(_data)
|
function this:OnOpen(_data)
|
||||||
|
this.UpdateWin(_data)
|
||||||
|
end
|
||||||
|
|
||||||
|
function this.UpdateWin(_data)
|
||||||
godwData=_data
|
godwData=_data
|
||||||
this.icon.sprite = this.spLoader:LoadSprite(GetResourcePath(_data.config.Icon))
|
this.icon.sprite = this.spLoader:LoadSprite(GetResourcePath(_data.config.Icon))
|
||||||
this.nameText.text=_data.config.Name
|
this.nameText.text=_data.config.Name
|
||||||
local starSize = Vector2.New(65,65)
|
local starSize = Vector2.New(65,65)
|
||||||
PokemonManager.SetHeroStars(this.spLoader, this.starGrid,godwData.star,1,starSize)
|
PokemonManager.SetHeroStars(this.spLoader, this.starGrid,_data.star,1,starSize)
|
||||||
local allPropDic=GodWeaponManager.GetSinglePokemonAddProData(_data.Did,_data.star)
|
local allPropDic=GodWeaponManager.GetSinglePokemonAddProData(_data.Did,_data.star)
|
||||||
local propInfoList={}
|
local propInfoList={}
|
||||||
propInfoList[1]={}
|
propInfoList[1]={}
|
||||||
|
|
|
@ -77,10 +77,15 @@ function this.SingleItemDataShow(_go,_itemData)
|
||||||
SetHeroStars(this.spLoader, Util.GetGameObject(_go.transform, "star/starGrid"), _itemData.star,1,starSize,-5,Vector2.New(0.5,0.5))
|
SetHeroStars(this.spLoader, Util.GetGameObject(_go.transform, "star/starGrid"), _itemData.star,1,starSize,-5,Vector2.New(0.5,0.5))
|
||||||
Util.AddOnceClick(Util.GetGameObject(_go.transform,"upZhen"), function()
|
Util.AddOnceClick(Util.GetGameObject(_go.transform,"upZhen"), function()
|
||||||
if curUpZhenPokemonData then
|
if curUpZhenPokemonData then
|
||||||
NetManager.RequestMagicSoldierExchange(curUpZhenPokemonData.Did,_itemData.dynamicId,function()
|
NetManager.RequestMagicSoldierLocation(curUpZhenPokemonData.Did,0,function()
|
||||||
GodWeaponManager.ChangeWeaponPos(curUpZhenPokemonData.Did,_itemData.dynamicId)
|
local upPos=curUpZhenPokemonData.point
|
||||||
local godWeaponData=GodWeaponManager.GetSingleWeaponData(_itemData.dynamicId)
|
GodWeaponManager.SetWeaponUpZhen(curUpZhenPokemonData.Did,0)
|
||||||
UIManager.OpenPanel(UIName.GodWeaponInfoPanel,godWeaponData)
|
NetManager.RequestMagicSoldierLocation(_itemData.dynamicId,upPos,function()
|
||||||
|
GodWeaponManager.SetWeaponUpZhen(_itemData.dynamicId,upPos)
|
||||||
|
local godWeaponData=GodWeaponManager.GetSingleWeaponData(_itemData.dynamicId)
|
||||||
|
Game.GlobalEvent:DispatchEvent(GameEvent.GodWeapon.RefreshGodWeaponInfoPanel,godWeaponData)
|
||||||
|
parent:ClosePanel()
|
||||||
|
end)
|
||||||
end)
|
end)
|
||||||
else
|
else
|
||||||
--上阵 协议
|
--上阵 协议
|
||||||
|
|
Loading…
Reference in New Issue