成员左右切换动画位置修改
parent
f7c842eb9a
commit
ae8aa71edf
|
@ -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()
|
||||
|
|
|
@ -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()
|
||||
|
|
Loading…
Reference in New Issue