图鉴添加皮肤页签

dev_chengFeng
jiaoyangna 2021-04-08 17:58:17 +08:00
parent dd98250771
commit c86307d328
2 changed files with 14 additions and 3 deletions

View File

@ -409,18 +409,21 @@ end
local beginV3 local beginV3
local endV3 local endV3
local distance local distance
function HandBookHeroInfoPanel:OnBeginDrag(Pointgo, data) function HandBookHeroInfoPanel:OnBeginDrag(Pointgo, data)
beginV3=this.curLiveObj.transform.anchoredPosition beginV3=this.curLiveObj.transform.anchoredPosition
end end
function HandBookHeroInfoPanel:OnDrag(Pointgo, data) function HandBookHeroInfoPanel:OnDrag(Pointgo, data)
distance=Vector2.Distance(beginV3,this.curLiveObj.transform.anchoredPosition) distance=Vector2.Distance(beginV3,this.curLiveObj.transform.anchoredPosition)
end end
function HandBookHeroInfoPanel:OnEndDrag(Pointgo, data) function HandBookHeroInfoPanel:OnEndDrag(Pointgo, data)
endV3=this.curLiveObj.transform.anchoredPosition endV3=this.curLiveObj.transform.anchoredPosition
if distance>250 and endV3.x<0 then if distance>250 and endV3.x<0 then
self:RightBtnOnClick() this:RightBtnOnClick()
elseif distance>250 and endV3.x>0 then elseif distance>250 and endV3.x>0 then
self:LeftBtnOnClick() this:LeftBtnOnClick()
else else
this.curLiveObj:GetComponent("RectTransform"):DOAnchorPos(Vector2.New(heroConFigData.Position[1],heroConFigData.Position[2]), 0.5, false):SetEase(Ease.Linear) this.curLiveObj:GetComponent("RectTransform"):DOAnchorPos(Vector2.New(heroConFigData.Position[1],heroConFigData.Position[2]), 0.5, false):SetEase(Ease.Linear)
end end
@ -429,7 +432,14 @@ end
--界面关闭时调用(用于子类重写) --界面关闭时调用(用于子类重写)
function HandBookHeroInfoPanel:OnClose() function HandBookHeroInfoPanel:OnClose()
for _, page in pairs(this.PageList) do
if page.OnHide then
page:OnHide()
end
if page.OnClose then
page:OnClose()
end
end
if this.leftLiveObj then if this.leftLiveObj then
poolManager:UnLoadLive(GetResourcePath(leftHeroData.Live), this.leftLiveObj) poolManager:UnLoadLive(GetResourcePath(leftHeroData.Live), this.leftLiveObj)
this.leftLiveObj = nil this.leftLiveObj = nil

View File

@ -130,6 +130,7 @@ function HandBookRoleSkinPanel:BtnAction(skinId,data)
end end
function HandBookRoleSkinPanel:OnHide() function HandBookRoleSkinPanel:OnHide()
LogGreen("11111111111111111111111111111111111")
this.gameObject:SetActive(false) this.gameObject:SetActive(false)
if parent then if parent then
parent:ChangeCurentHeroSkinLive() parent:ChangeCurentHeroSkinLive()