【皮肤】修复未解锁皮肤,拖动不切换回到默认位置时显示错误

dev_chengFeng
gaoxin 2020-12-21 18:45:03 +08:00
parent 03e3d77bb6
commit f26796653d
1 changed files with 7 additions and 1 deletions

View File

@ -26,6 +26,7 @@ local tabs = {
local curHeroData--当前英雄信息 local curHeroData--当前英雄信息
local leftHeroData--左边预加载英雄信息 local leftHeroData--左边预加载英雄信息
local rightHeroData--右边预加载英雄信息 local rightHeroData--右边预加载英雄信息
local curHeroPosition --
local heroDatas--所有英雄list信息 local heroDatas--所有英雄list信息
@ -581,6 +582,8 @@ function this:ChangeCurentHeroSkinLive(herodata)
end end
if herodata then if herodata then
this.curLiveObj=HeroManager.LoadHerolive1(herodata,this.curObj) this.curLiveObj=HeroManager.LoadHerolive1(herodata,this.curObj)
-- 临时保存皮肤位置
curHeroPosition = herodata.Position
else else
local allAddProVal = {} local allAddProVal = {}
if isUpZhen then if isUpZhen then
@ -592,6 +595,8 @@ function this:ChangeCurentHeroSkinLive(herodata)
end end
this.force.text =allAddProVal[HeroProType.WarPower] this.force.text =allAddProVal[HeroProType.WarPower]
this.curLiveObj=HeroManager.LoadHerolive(curHeroData,this.curObj) this.curLiveObj=HeroManager.LoadHerolive(curHeroData,this.curObj)
-- 清空临时保存的皮肤位置
curHeroPosition = nil
end end
this:SetDragView() this:SetDragView()
end end
@ -621,7 +626,8 @@ function RoleInfoPanel:OnEndDrag(Pointgo, data)
elseif distance>250 and endV3.x>0 then elseif distance>250 and endV3.x>0 then
this:LeftBtnOnClick() this:LeftBtnOnClick()
else else
this.curLiveObj:GetComponent("RectTransform"):DOAnchorPos(Vector2.New(curHeroData.position[1],curHeroData.position[2]), 0.5, false):SetEase(Ease.Linear) local pos = curHeroPosition or curHeroData.position
this.curLiveObj:GetComponent("RectTransform"):DOAnchorPos(Vector2.New(pos[1], pos[2]), 0.5, false):SetEase(Ease.Linear)
end end
distance=0 distance=0
end end