玲珑宝镜间隔修改提交
parent
a1a3eda93c
commit
0705837511
|
@ -17961,7 +17961,7 @@ MonoBehaviour:
|
|||
m_HighlightedTrigger: Highlighted
|
||||
m_PressedTrigger: Pressed
|
||||
m_DisabledTrigger: Disabled
|
||||
m_Interactable: 1
|
||||
m_Interactable: 0
|
||||
m_TargetGraphic: {fileID: 274537479923507172}
|
||||
m_FillRect: {fileID: 4657106037686168073}
|
||||
m_HandleRect: {fileID: 4121816818301003409}
|
||||
|
|
|
@ -21,6 +21,15 @@ local isClose = false
|
|||
local drop = nil
|
||||
local skip = 0
|
||||
local actconfigs
|
||||
local itemWidth,interval = 0,0
|
||||
|
||||
local position = {
|
||||
[1] = 74.3,
|
||||
[2] = 211.9,
|
||||
[3] = 348.7,
|
||||
[4] = 486.3,
|
||||
[5] = 654.25,
|
||||
}
|
||||
---初始化组件(用于子类重写)
|
||||
function LingLongBaoJingPanel:InitComponent(gameObject)
|
||||
self.spLoader = SpriteLoader.New()
|
||||
|
@ -108,7 +117,7 @@ function LingLongBaoJingPanel:InitComponent(gameObject)
|
|||
self.rewardBoxList[i].Num=Util.GetGameObject(self.rewardBoxList[i].go,"Num/Text"):GetComponent("Text")--幸运值
|
||||
end
|
||||
|
||||
|
||||
local itemWidth = self.rewardBoxList[1].go:GetComponent("RectTransform").sizeDelta.x
|
||||
self.skip = Util.GetGameObject(self.gameObject,"button/skip")
|
||||
self.check = Util.GetGameObject(self.skip,"Go")
|
||||
self.checkText = Util.GetGameObject(self.skip,"Text"):GetComponent("Text")--幸运值
|
||||
|
@ -549,15 +558,16 @@ end
|
|||
---刷新幸运值
|
||||
function LingLongBaoJingPanel:RefreshLuckyValue()
|
||||
configs = ConfigManager.GetAllConfigsDataByKey(ConfigName.ActivityRewardConfig,"ActivityId",self.actId)
|
||||
--interval = self.rewardBox.transform.rect.width - (itemWidth * #configs)
|
||||
local list = {}
|
||||
for k,v in ipairs(configs) do
|
||||
table.insert(list,v.Values[1][1])
|
||||
end
|
||||
table.sort(list,function(a,b) return a < b end)
|
||||
local pos = self:CalutePos1(self.rewardBox,list)
|
||||
--local pos = self:CalutePos2(self.rewardBox,list)
|
||||
for i = 1,5 do
|
||||
local v3 = self.rewardBoxList[i].go:GetComponent("RectTransform").anchoredPosition3D
|
||||
v3.x = pos[i]
|
||||
v3.x = position[i]
|
||||
self.rewardBoxList[i].go:GetComponent("RectTransform").anchoredPosition3D = v3
|
||||
self.rewardBoxList[i].value.text = configs[i].Values[1][1].."次"
|
||||
self.rewardBoxList[i].redPoint.gameObject:SetActive(false)
|
||||
|
@ -579,19 +589,38 @@ function LingLongBaoJingPanel:RefreshLuckyValue()
|
|||
end)
|
||||
end
|
||||
self.luckySlider.minValue = 0
|
||||
self.luckySlider.maxValue = configs[#configs].Values[1][1]
|
||||
self.luckySlider.maxValue = 1
|
||||
self:RefreshProgress()
|
||||
end
|
||||
|
||||
function LingLongBaoJingPanel:CalutePos1(parent,list)
|
||||
local pos = {}
|
||||
local wi = parent.transform.rect.width
|
||||
for i = 1,#list do
|
||||
local pos1 = wi * (list[i]/list[#list])
|
||||
table.insert(pos,pos1)
|
||||
end
|
||||
return pos
|
||||
end
|
||||
-- function LingLongBaoJingPanel:CalutePos1(parent,list)
|
||||
-- local pos = {}
|
||||
-- local wi = self.rewardBox.transform.rect.width
|
||||
-- for i = 1,#list do
|
||||
-- local pos1 = wi * (list[i]/list[#list])
|
||||
-- table.insert(pos,pos1)
|
||||
-- end
|
||||
-- return pos
|
||||
-- end
|
||||
|
||||
-- function LingLongBaoJingPanel:CalutePos2(parent,list)
|
||||
-- local pos = {}
|
||||
-- local tmp = 0
|
||||
-- local count = list[#list]
|
||||
-- local tempinterval = 0
|
||||
-- local position = 0
|
||||
-- local wi = self.rewardBox.transform.rect.width
|
||||
-- for i = 1,#list do
|
||||
-- tempinterval = (list[i] - tmp) / count * interval
|
||||
-- if i == 1 then
|
||||
-- position = tempinterval
|
||||
-- else
|
||||
-- position = tempinterval + itemWidth + position
|
||||
-- end
|
||||
-- table.insert(pos,position)
|
||||
-- end
|
||||
-- return pos
|
||||
-- end
|
||||
|
||||
function LingLongBaoJingPanel.RefreshProgress1(self)
|
||||
self:RefreshProgress()
|
||||
|
@ -601,7 +630,7 @@ function LingLongBaoJingPanel:RefreshProgress(index)
|
|||
CheckRedPointStatus(RedPointType.linglongBaojing)
|
||||
actconfigs = ActivityGiftManager.GetActivityInfoByType(self.actId)
|
||||
LogGreen("actconfigs.mission[1].progress:"..actconfigs.mission[1].progress)
|
||||
self.luckySlider.value = actconfigs.mission[1].progress
|
||||
self.luckySlider.value = self:CalculateInterval(actconfigs.mission[1].progress)
|
||||
self.luckyValueNum.text = actconfigs.mission[1].progress.."/"..configs[#configs].Values[1][1]
|
||||
if index and index > 0 then
|
||||
self.rewardBoxList[index].redPoint.gameObject:SetActive(false)
|
||||
|
@ -617,6 +646,27 @@ function LingLongBaoJingPanel:RefreshProgress(index)
|
|||
end
|
||||
end
|
||||
|
||||
function LingLongBaoJingPanel:CalculateInterval(count)
|
||||
if not configs or #configs < 1 then
|
||||
configs = ConfigManager.GetAllConfigsDataByKey(ConfigName.ActivityRewardConfig,"ActivityId",self.actId)
|
||||
end
|
||||
local interval = 0
|
||||
if count >= configs[5].Values[1][1] then
|
||||
interval = 1
|
||||
elseif count >= configs[4].Values[1][1] then
|
||||
interval = position[4]/position[5] + ((count - configs[4].Values[1][1]) * (position[5] - position[4]) / (configs[5].Values[1][1] - configs[4].Values[1][1]))/position[5]
|
||||
elseif count >= configs[3].Values[1][1] then
|
||||
interval = position[3]/position[5] + ((count - configs[3].Values[1][1]) * (position[5] - position[4]) / (configs[4].Values[1][1] - configs[3].Values[1][1]))/position[5]
|
||||
elseif count >= configs[2].Values[1][1] then
|
||||
interval = position[2]/position[5] + ((count - configs[2].Values[1][1]) * (position[5] - position[4]) / (configs[3].Values[1][1] - configs[2].Values[1][1]))/position[5]
|
||||
elseif count >= configs[1].Values[1][1] then
|
||||
interval = position[1]/position[5] + ((count - configs[1].Values[1][1]) * (position[5] - position[4]) / (configs[2].Values[1][1] - configs[1].Values[1][1]))/position[5]
|
||||
else
|
||||
interval = count / configs[1].Values[1][1]
|
||||
end
|
||||
return interval
|
||||
end
|
||||
|
||||
---延时遮罩 1按时间
|
||||
function LingLongBaoJingPanel:DelayMaskWithTime(delayTime)
|
||||
self.mask.gameObject:SetActive(true)
|
||||
|
|
Loading…
Reference in New Issue