From f26796653d6047d027cd51f59ec47884e9959f2a Mon Sep 17 00:00:00 2001 From: gaoxin Date: Mon, 21 Dec 2020 18:45:03 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E7=9A=AE=E8=82=A4=E3=80=91=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D=E6=9C=AA=E8=A7=A3=E9=94=81=E7=9A=AE=E8=82=A4=EF=BC=8C?= =?UTF-8?q?=E6=8B=96=E5=8A=A8=E4=B8=8D=E5=88=87=E6=8D=A2=E5=9B=9E=E5=88=B0?= =?UTF-8?q?=E9=BB=98=E8=AE=A4=E4=BD=8D=E7=BD=AE=E6=97=B6=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../~Lua/Modules/RoleInfo/RoleInfoPanel.lua | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Assets/ManagedResources/~Lua/Modules/RoleInfo/RoleInfoPanel.lua b/Assets/ManagedResources/~Lua/Modules/RoleInfo/RoleInfoPanel.lua index f9ceedc9a0..fe74fd8bb2 100644 --- a/Assets/ManagedResources/~Lua/Modules/RoleInfo/RoleInfoPanel.lua +++ b/Assets/ManagedResources/~Lua/Modules/RoleInfo/RoleInfoPanel.lua @@ -26,6 +26,7 @@ local tabs = { local curHeroData--当前英雄信息 local leftHeroData--左边预加载英雄信息 local rightHeroData--右边预加载英雄信息 +local curHeroPosition -- local heroDatas--所有英雄list信息 @@ -581,6 +582,8 @@ function this:ChangeCurentHeroSkinLive(herodata) end if herodata then this.curLiveObj=HeroManager.LoadHerolive1(herodata,this.curObj) + -- 临时保存皮肤位置 + curHeroPosition = herodata.Position else local allAddProVal = {} if isUpZhen then @@ -592,6 +595,8 @@ function this:ChangeCurentHeroSkinLive(herodata) end this.force.text =allAddProVal[HeroProType.WarPower] this.curLiveObj=HeroManager.LoadHerolive(curHeroData,this.curObj) + -- 清空临时保存的皮肤位置 + curHeroPosition = nil end this:SetDragView() end @@ -621,7 +626,8 @@ function RoleInfoPanel:OnEndDrag(Pointgo, data) elseif distance>250 and endV3.x>0 then this:LeftBtnOnClick() 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 distance=0 end