天宫秘宝额外奖励界面
parent
1ad1aaa2d4
commit
d02a997cb0
|
@ -20277,7 +20277,7 @@ RectTransform:
|
||||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||||
m_AnchorMin: {x: 0, y: 0}
|
m_AnchorMin: {x: 0, y: 0}
|
||||||
m_AnchorMax: {x: 1, y: 1}
|
m_AnchorMax: {x: 1, y: 1}
|
||||||
m_AnchoredPosition: {x: 0, y: -0.00001323921}
|
m_AnchoredPosition: {x: 0, y: -0.000030405978}
|
||||||
m_SizeDelta: {x: -894.3, y: -817.3}
|
m_SizeDelta: {x: -894.3, y: -817.3}
|
||||||
m_Pivot: {x: 0, y: 1}
|
m_Pivot: {x: 0, y: 1}
|
||||||
--- !u!114 &7488345345668227506
|
--- !u!114 &7488345345668227506
|
||||||
|
@ -22974,8 +22974,8 @@ RectTransform:
|
||||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||||
m_AnchorMin: {x: 0.5, y: 0.5}
|
m_AnchorMin: {x: 0.5, y: 0.5}
|
||||||
m_AnchorMax: {x: 0.5, y: 0.5}
|
m_AnchorMax: {x: 0.5, y: 0.5}
|
||||||
m_AnchoredPosition: {x: -30.88, y: -359.5}
|
m_AnchoredPosition: {x: 4.8, y: -359.5}
|
||||||
m_SizeDelta: {x: 547.84, y: 77.3}
|
m_SizeDelta: {x: 619.2, y: 77.3}
|
||||||
m_Pivot: {x: 0.5, y: 0.5}
|
m_Pivot: {x: 0.5, y: 0.5}
|
||||||
--- !u!222 &1221536551871023808
|
--- !u!222 &1221536551871023808
|
||||||
CanvasRenderer:
|
CanvasRenderer:
|
||||||
|
@ -23018,7 +23018,7 @@ MonoBehaviour:
|
||||||
m_HorizontalOverflow: 0
|
m_HorizontalOverflow: 0
|
||||||
m_VerticalOverflow: 1
|
m_VerticalOverflow: 1
|
||||||
m_LineSpacing: 1
|
m_LineSpacing: 1
|
||||||
m_Text: "<color=#60A22C>\u89E3\u9501\u9AD8\u9636\u6218\u4EE4\uFF0C\u6FC0\u6D3B\u8FDB\u9636</color><color=#95523B>\u4E13\u5C5E\u5956\u52B1+\u76F4\u534715\u7EA7</color><color=#60A22C>\u89E3\u9501\u7ACB\u83B7\u9650\u5B9A\u79F0\u53F7+\u9650\u5B9A\u6C14\u6CE1</color>"
|
m_Text: "<color=#60A22C>\u89E3\u9501\u9AD8\u9636\u6218\u4EE4\uFF0C\u6FC0\u6D3B\u8FDB\u9636</color><color=#95523B>\u4E13\u5C5E\u5956\u52B1+\u76F4\u534715\u7EA7</color>"
|
||||||
--- !u!114 &5087427704777140632
|
--- !u!114 &5087427704777140632
|
||||||
MonoBehaviour:
|
MonoBehaviour:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
|
@ -25252,7 +25252,7 @@ RectTransform:
|
||||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||||
m_AnchorMin: {x: 0.5, y: 0.5}
|
m_AnchorMin: {x: 0.5, y: 0.5}
|
||||||
m_AnchorMax: {x: 0.5, y: 0.5}
|
m_AnchorMax: {x: 0.5, y: 0.5}
|
||||||
m_AnchoredPosition: {x: -4.3, y: -169}
|
m_AnchoredPosition: {x: -4.299988, y: -169}
|
||||||
m_SizeDelta: {x: 494.6, y: 77.3}
|
m_SizeDelta: {x: 494.6, y: 77.3}
|
||||||
m_Pivot: {x: 0.5, y: 0.5}
|
m_Pivot: {x: 0.5, y: 0.5}
|
||||||
--- !u!222 &6559398893788723828
|
--- !u!222 &6559398893788723828
|
||||||
|
|
|
@ -24,8 +24,7 @@ function this:InitComponent(gameObject)
|
||||||
this.box1 = Util.GetGameObject(this.Content, "scroll/box")
|
this.box1 = Util.GetGameObject(this.Content, "scroll/box")
|
||||||
this.box2 = Util.GetGameObject(this.Content, "scroll2/box")
|
this.box2 = Util.GetGameObject(this.Content, "scroll2/box")
|
||||||
this.tip = Util.GetGameObject(this.Content, "Text"):GetComponent("Text")
|
this.tip = Util.GetGameObject(this.Content, "Text"):GetComponent("Text")
|
||||||
this.taskList1 = {}
|
this.taskList = {}
|
||||||
this.taskList2 = {}
|
|
||||||
end
|
end
|
||||||
|
|
||||||
--绑定事件(用于子类重写)
|
--绑定事件(用于子类重写)
|
||||||
|
@ -84,27 +83,32 @@ function this:showRewardTianGong()
|
||||||
|
|
||||||
local direct = {}
|
local direct = {}
|
||||||
local indirect ={}
|
local indirect ={}
|
||||||
|
local curScore = TreasureOfHeavenManger.GetScore()--当前分数
|
||||||
|
|
||||||
for i = 1, #rewardData do
|
for i = 1, #rewardData do
|
||||||
if rewardStateData[i].state == 1 then--已达成但不能领取的
|
LogRed("state:"..rewardStateData[rewardData[i].Id].state)
|
||||||
-- body
|
if curScore >= rewardData[i].Integral then
|
||||||
local reward = rewardData[i]
|
if rewardStateData[i].state == 1 or rewardStateData[i].state == 0 then--已达成但不能领取的
|
||||||
local k1 = reward.TreasureReward[1][1]
|
-- body
|
||||||
local v1 = reward.TreasureReward[1][2]
|
LogRed("执行这里了么")
|
||||||
local k2 = reward.TreasureReward[2][1]
|
local reward = rewardData[i]
|
||||||
local v2 = reward.TreasureReward[2][2]
|
local k1 = reward.TreasureReward[1][1]
|
||||||
|
local v1 = reward.TreasureReward[1][2]
|
||||||
if not direct[k1] then
|
local k2 = reward.TreasureReward[2][1]
|
||||||
direct[k1] = 0
|
local v2 = reward.TreasureReward[2][2]
|
||||||
|
|
||||||
|
if not direct[k1] then
|
||||||
|
direct[k1] = 0
|
||||||
|
end
|
||||||
|
direct[k1] = direct[k1] + v1
|
||||||
|
|
||||||
|
if not direct[k2] then
|
||||||
|
direct[k2] = 0
|
||||||
|
end
|
||||||
|
direct[k2] = direct[k2] + v2
|
||||||
end
|
end
|
||||||
direct[k1] = direct[k1] + v1
|
else
|
||||||
|
-- elseif rewardStateData[i].state == 0 then--未达成且不能领取的
|
||||||
if not direct[k2] then
|
|
||||||
direct[k2] = 0
|
|
||||||
end
|
|
||||||
direct[k2] = direct[k2] + v2
|
|
||||||
|
|
||||||
elseif rewardStateData[i].state == 0 then--未达成且不能领取的
|
|
||||||
local reward = rewardData[i]
|
local reward = rewardData[i]
|
||||||
local k1 = reward.TreasureReward[1][1]
|
local k1 = reward.TreasureReward[1][1]
|
||||||
local v1 = reward.TreasureReward[1][2]
|
local v1 = reward.TreasureReward[1][2]
|
||||||
|
@ -121,25 +125,39 @@ function this:showRewardTianGong()
|
||||||
end
|
end
|
||||||
indirect[k2] = indirect[k2] + v2
|
indirect[k2] = indirect[k2] + v2
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
if #this.taskList == 0 then
|
for i = 1,#this.taskList do
|
||||||
for key, value in pairs(direct) do
|
this.taskList[i].gameObject:SetActive(false)
|
||||||
|
end
|
||||||
|
|
||||||
|
local index = 1
|
||||||
|
for key, value in pairs(direct) do
|
||||||
|
if not this.taskList[index] then
|
||||||
local item = SubUIManager.Open(SubUIConfig.ItemView, this.box1.transform)
|
local item = SubUIManager.Open(SubUIConfig.ItemView, this.box1.transform)
|
||||||
item:OnOpen(false,{key, value},0.9)
|
this.taskList[index] = item
|
||||||
table.insert(this.taskList,{key, value})
|
|
||||||
end
|
end
|
||||||
if LengthOfTable(direct) > 0 then
|
this.taskList[index].gameObject:SetActive(true)
|
||||||
Util.GetGameObject(this.Content, "empty").gameObject:SetActive(false)
|
this.taskList[index].gameObject.transform:SetParent(this.box1.transform)
|
||||||
else
|
this.taskList[index].gameObject:GetComponent("RectTransform").localPosition = Vector3.zero
|
||||||
Util.GetGameObject(this.Content, "empty").gameObject:SetActive(true)
|
this.taskList[index]:OnOpen(false,{key, value},0.95)
|
||||||
end
|
index = index + 1
|
||||||
for key, value in pairs(indirect) do
|
end
|
||||||
|
if LengthOfTable(direct) > 0 then
|
||||||
|
Util.GetGameObject(this.Content, "empty").gameObject:SetActive(false)
|
||||||
|
else
|
||||||
|
Util.GetGameObject(this.Content, "empty").gameObject:SetActive(true)
|
||||||
|
end
|
||||||
|
for key, value in pairs(indirect) do
|
||||||
|
if not this.taskList[index] then
|
||||||
local item = SubUIManager.Open(SubUIConfig.ItemView, this.box2.transform)
|
local item = SubUIManager.Open(SubUIConfig.ItemView, this.box2.transform)
|
||||||
item:OnOpen(false,{key, value},0.9)
|
this.taskList[index] = item
|
||||||
table.insert(this.taskList,{key, value})
|
|
||||||
end
|
end
|
||||||
|
this.taskList[index].gameObject:SetActive(true)
|
||||||
|
this.taskList[index].gameObject.transform:SetParent(this.box2.transform)
|
||||||
|
this.taskList[index].gameObject:GetComponent("RectTransform").localPosition = Vector3.zero
|
||||||
|
this.taskList[index]:OnOpen(false,{key, value},0.95)
|
||||||
|
index = index + 1
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -175,13 +193,13 @@ function this:showRewardQinglong()
|
||||||
|
|
||||||
local index = 1
|
local index = 1
|
||||||
for key, value in pairs(direct) do
|
for key, value in pairs(direct) do
|
||||||
if not this.taskLtaskListist1[index] then
|
if not this.taskList[index] then
|
||||||
local item = SubUIManager.Open(SubUIConfig.ItemView, this.box1.transform)
|
local item = SubUIManager.Open(SubUIConfig.ItemView, this.box1.transform)
|
||||||
this.taskList[index] = item
|
this.taskList[index] = item
|
||||||
end
|
end
|
||||||
this.taskList[index].gameObject:SetActive(true)
|
this.taskList[index].gameObject:SetActive(true)
|
||||||
this.taskList[index].gameObject.transform:SetParent(this.box1.transform)
|
this.taskList[index].gameObject.transform:SetParent(this.box1.transform)
|
||||||
this.taskList[index].gameObject:GetComponent("RectTransForm").localPosition = Vector3.zero
|
this.taskList[index].gameObject:GetComponent("RectTransform").localPosition = Vector3.zero
|
||||||
this.taskList[index]:OnOpen(false,{key, value},0.95)
|
this.taskList[index]:OnOpen(false,{key, value},0.95)
|
||||||
index = index + 1
|
index = index + 1
|
||||||
end
|
end
|
||||||
|
@ -197,7 +215,7 @@ function this:showRewardQinglong()
|
||||||
end
|
end
|
||||||
this.taskList[index].gameObject:SetActive(true)
|
this.taskList[index].gameObject:SetActive(true)
|
||||||
this.taskList[index].gameObject.transform:SetParent(this.box2.transform)
|
this.taskList[index].gameObject.transform:SetParent(this.box2.transform)
|
||||||
this.taskList[index].gameObject:GetComponent("RectTransForm").localPosition = Vector3.zero
|
this.taskList[index].gameObject:GetComponent("RectTransform").localPosition = Vector3.zero
|
||||||
this.taskList[index]:OnOpen(false,{key, value},0.95)
|
this.taskList[index]:OnOpen(false,{key, value},0.95)
|
||||||
index = index + 1
|
index = index + 1
|
||||||
end
|
end
|
||||||
|
|
|
@ -100,7 +100,7 @@ function TreasureOfHeavenPanel:topBar()
|
||||||
|
|
||||||
if treasureState == 0 then
|
if treasureState == 0 then
|
||||||
Util.AddOnceClick(this.buyBtn,function()
|
Util.AddOnceClick(this.buyBtn,function()
|
||||||
UIManager.OpenPanel(UIName.HeavenUnlockExtraRewardPanel,1)
|
UIManager.OpenPanel(UIName.GeneralPopup,GENERAL_POPUP_TYPE.HeavenUnlockExtraRewardPanel,1)
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -231,7 +231,7 @@ function TreasureOfHeavenPanel:OnBtnDealClicked(rewardItem,rewardSingleData)
|
||||||
TreasureOfHeavenPanel:refresh()--刷新界面
|
TreasureOfHeavenPanel:refresh()--刷新界面
|
||||||
end)
|
end)
|
||||||
elseif rewardStateData[rewardSingleData.Id].state == 1 and treasureState == 0 then----任务已领取+礼包未购买(弹出购买界面)
|
elseif rewardStateData[rewardSingleData.Id].state == 1 and treasureState == 0 then----任务已领取+礼包未购买(弹出购买界面)
|
||||||
UIManager.OpenPanel(UIName.HeavenUnlockExtraRewardPanel,1)
|
UIManager.OpenPanel(UIName.GeneralPopup,GENERAL_POPUP_TYPE.HeavenUnlockExtraRewardPanel,1)
|
||||||
end
|
end
|
||||||
else--分数未达到要求
|
else--分数未达到要求
|
||||||
PopupTipPanel.ShowTip(Language[11989])
|
PopupTipPanel.ShowTip(Language[11989])
|
||||||
|
|
Loading…
Reference in New Issue