From ae8aa71edf1406ea3ec6230ac70d04190e094612 Mon Sep 17 00:00:00 2001 From: zhangqiang <657634622@qq.com> Date: Fri, 3 Jul 2020 18:24:44 +0800 Subject: [PATCH] =?UTF-8?q?=E6=88=90=E5=91=98=E5=B7=A6=E5=8F=B3=E5=88=87?= =?UTF-8?q?=E6=8D=A2=E5=8A=A8=E7=94=BB=E4=BD=8D=E7=BD=AE=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../~Lua/Modules/HandBook/HandBookHeroInfoPanel.lua | 7 ++++--- .../~Lua/Modules/RoleInfo/RoleInfoPanel.lua | 6 ++++-- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/Assets/ManagedResources/~Lua/Modules/HandBook/HandBookHeroInfoPanel.lua b/Assets/ManagedResources/~Lua/Modules/HandBook/HandBookHeroInfoPanel.lua index 02e6f65cfe..c9b63ee2a0 100644 --- a/Assets/ManagedResources/~Lua/Modules/HandBook/HandBookHeroInfoPanel.lua +++ b/Assets/ManagedResources/~Lua/Modules/HandBook/HandBookHeroInfoPanel.lua @@ -402,6 +402,7 @@ function HandBookHeroInfoPanel:RightBtnOnClick() end isClickLeftOrRightBtn = false self.rightBtn:GetComponent("Button").enabled = false + local oldIndexConfigData = heroDatas[index] index =rightIndex if _curStar ~= _rightStar then _curStar = _rightStar @@ -414,7 +415,7 @@ function HandBookHeroInfoPanel:RightBtnOnClick() end this.curLiveObj.transform:SetParent(self.leftObj.transform) - 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(oldIndexConfigData.Position[1],oldIndexConfigData.Position[2]), 0.5, false):SetEase(Ease.Linear) this.rightLiveObj.transform:SetParent(self.curObj.transform) this.rightLiveObj:GetComponent("RectTransform"):DOAnchorPos(Vector2.New(rightHeroData.Position[1],rightHeroData.Position[2]), 0.5, false):OnComplete(function () this:UpdateLiveList() @@ -444,7 +445,7 @@ function HandBookHeroInfoPanel:LeftBtnOnClick() end isClickLeftOrRightBtn = false self.leftBtn:GetComponent("Button").enabled = false - + local oldIndexConfigData = heroDatas[index] index =leftIndex if _curStar~= _leftStar then _curStar = _leftStar @@ -457,7 +458,7 @@ function HandBookHeroInfoPanel:LeftBtnOnClick() this.rightLiveObj = nil end this.curLiveObj.transform:SetParent(self.rightObj.transform) - 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(oldIndexConfigData.Position[1],oldIndexConfigData.Position[2]), 0.5, false):SetEase(Ease.Linear) this.leftLiveObj.transform:SetParent(self.curObj.transform) this.leftLiveObj:GetComponent("RectTransform"):DOAnchorPos(Vector2.New(leftHeroData.Position[1],leftHeroData.Position[2]), 0.5, false):OnComplete(function () this:UpdateLiveList() diff --git a/Assets/ManagedResources/~Lua/Modules/RoleInfo/RoleInfoPanel.lua b/Assets/ManagedResources/~Lua/Modules/RoleInfo/RoleInfoPanel.lua index 7338250749..59dd1e0281 100644 --- a/Assets/ManagedResources/~Lua/Modules/RoleInfo/RoleInfoPanel.lua +++ b/Assets/ManagedResources/~Lua/Modules/RoleInfo/RoleInfoPanel.lua @@ -1108,6 +1108,7 @@ function this:RightBtnOnClick() end isClickLeftOrRightBtn = false this.rightBtn:GetComponent("Button").enabled = false + local oldIndexConfigData = heroDatas[index] index = (index + 1 <= #heroDatas and index + 1 or 1) curHeroData = heroDatas[index] if this.leftLiveObj then @@ -1115,7 +1116,7 @@ function this:RightBtnOnClick() this.leftLiveObj = nil end this.curLiveObj.transform:SetParent(self.leftObj.transform) - this.curLiveObj:GetComponent("RectTransform"):DOAnchorPos(Vector2.New(curHeroData.position[1],curHeroData.position[2]), 0.5, false):SetEase(Ease.Linear) + this.curLiveObj:GetComponent("RectTransform"):DOAnchorPos(Vector2.New(oldIndexConfigData.position[1],oldIndexConfigData.position[2]), 0.5, false):SetEase(Ease.Linear) this.rightLiveObj.transform:SetParent(self.curObj.transform) this.rightLiveObj:GetComponent("RectTransform"):DOAnchorPos(Vector2.New(rightHeroData.position[1],rightHeroData.position[2]), 0.5, false):OnComplete(function () this:UpdateLiveList() @@ -1136,6 +1137,7 @@ function this:LeftBtnOnClick() end isClickLeftOrRightBtn = false this.leftBtn:GetComponent("Button").enabled = false + local oldIndexConfigData = heroDatas[index] index = (index - 1 > 0 and index - 1 or #heroDatas) curHeroData = heroDatas[index] if this.rightLiveObj then @@ -1143,7 +1145,7 @@ function this:LeftBtnOnClick() this.rightLiveObj = nil end this.curLiveObj.transform:SetParent(self.rightObj.transform) - this.curLiveObj:GetComponent("RectTransform"):DOAnchorPos(Vector2.New(curHeroData.position[1],curHeroData.position[2]), 0.5, false):SetEase(Ease.Linear) + this.curLiveObj:GetComponent("RectTransform"):DOAnchorPos(Vector2.New(oldIndexConfigData.position[1],oldIndexConfigData.position[2]), 0.5, false):SetEase(Ease.Linear) this.leftLiveObj.transform:SetParent(self.curObj.transform) this.leftLiveObj:GetComponent("RectTransform"):DOAnchorPos(Vector2.New(leftHeroData.position[1],leftHeroData.position[2]), 0.5, false):OnComplete(function () this:UpdateLiveList()