首充修改
parent
7542d5e607
commit
040fd77db0
|
@ -199,15 +199,47 @@ function FirstRechargePanel:OnTabChanged(index)
|
||||||
self.stageImage100.gameObject:SetActive(index == 2)
|
self.stageImage100.gameObject:SetActive(index == 2)
|
||||||
self:ShowContent(index)
|
self:ShowContent(index)
|
||||||
self.selectTabIndex = index
|
self.selectTabIndex = index
|
||||||
self.rewardGrid.transform.localPosition = self.rewardGridPos
|
local AccumRecharge = 0
|
||||||
|
self.offsetIndex = 0
|
||||||
|
local tempData = {}
|
||||||
|
local day = GetTimePass(FirstRechargeManager.GetRechargeTime())--FirstRechargeManager.GetRechargeTime()
|
||||||
|
for _, missInfo in pairs(self.activityInfo.mission) do
|
||||||
|
if missInfo.missionId then
|
||||||
|
if activityRewardConfig[missInfo.missionId].Values[1][1] == IndexValueDef[MoneyUtil.MT][index] then
|
||||||
|
table.insert(tempData,missInfo)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
table.sort(tempData,function(a,b)
|
||||||
|
return a.missionId < b.missionId
|
||||||
|
end)
|
||||||
|
for _, missInfo in ipairs(tempData) do
|
||||||
|
if missInfo and missInfo.progress and activityRewardConfig[missInfo.missionId].Values[1][1] == IndexValueDef[MoneyUtil.MT][index] then
|
||||||
|
AccumRecharge = missInfo.progress
|
||||||
|
if AccumRecharge >= missInfo.progress and missInfo.state ~= 1 and activityRewardConfig[missInfo.missionId].Values[1][2] <= day then
|
||||||
|
self.offsetIndex = _
|
||||||
|
break
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
if self.offsetIndex == 0 then
|
||||||
|
self.offsetIndex = 1
|
||||||
|
end
|
||||||
if self.isPlayAnim then
|
if self.isPlayAnim then
|
||||||
self.isPlayAnim = false
|
self.isPlayAnim = false
|
||||||
local vec = self.rewardGrid.transform.localPosition
|
local vec = self.rewardGrid.transform.localPosition
|
||||||
vec.x = self.rewardGridPos.x - #self.activityInfo.mission * self.itemWidth
|
vec.x = self.rewardGridPos.x - #tempData * self.itemWidth
|
||||||
self.rewardGrid.transform.localPosition = vec
|
self.rewardGrid.transform.localPosition = vec
|
||||||
self.tween = self.rewardGrid.gameObject.transform:DOLocalMove(self.rewardGridPos, 1):OnStart(function() end):OnUpdate(function() --TODO:测试速度
|
local x = self.rewardGridPos.x - (self.offsetIndex - 1) * self.itemWidth
|
||||||
end):OnComplete(function ()
|
local vec2 = Vector3.New(x,self.rewardGridPos.y,self.rewardGridPos.z)
|
||||||
end):SetEase(Ease.Linear)
|
self.tween = self.rewardGrid.gameObject.transform:DOLocalMove(vec2, 0.5):OnStart(function() end):OnUpdate(function() --TODO:测试速度
|
||||||
|
end):OnComplete(function ()
|
||||||
|
--self.rewardGrid.transform.localPosition = vec2
|
||||||
|
end)
|
||||||
|
else
|
||||||
|
local x = self.rewardGridPos.x - (self.offsetIndex - 1) * self.itemWidth
|
||||||
|
local vec2 = Vector3.New(x,self.rewardGridPos.y,self.rewardGridPos.z)
|
||||||
|
self.rewardGrid.transform.localPosition = vec2
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -272,6 +304,7 @@ function FirstRechargePanel:OnClose()
|
||||||
fun()
|
fun()
|
||||||
fun = nil
|
fun = nil
|
||||||
end
|
end
|
||||||
|
self.rewardGrid.transform.localPosition = self.rewardGridPos
|
||||||
end
|
end
|
||||||
|
|
||||||
function FirstRechargePanel:OnDestroy()
|
function FirstRechargePanel:OnDestroy()
|
||||||
|
|
Loading…
Reference in New Issue