【探宝优化】增加每日探宝次数限制
parent
b682f97e66
commit
ee95a1ee55
|
|
@ -380,6 +380,7 @@ RectTransform:
|
|||
m_Children:
|
||||
- {fileID: 8033294340987751734}
|
||||
- {fileID: 3626902369047289888}
|
||||
- {fileID: 8182329026388935402}
|
||||
- {fileID: 9019243075872795323}
|
||||
- {fileID: 5669664509931292375}
|
||||
- {fileID: 6138877246532216303}
|
||||
|
|
@ -588,7 +589,7 @@ RectTransform:
|
|||
- {fileID: 4655393389923758693}
|
||||
- {fileID: 2156677597915279036}
|
||||
m_Father: {fileID: 7035216596183516586}
|
||||
m_RootOrder: 2
|
||||
m_RootOrder: 3
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0.5, y: 0.5}
|
||||
m_AnchorMax: {x: 0.5, y: 0.5}
|
||||
|
|
@ -1597,7 +1598,6 @@ MonoBehaviour:
|
|||
m_Script: {fileID: 11500000, guid: fcf53bbee510dca40b2f81e3c0d426c6, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
tweenSequeue1:
|
||||
tweenSequeue:
|
||||
- initV3: {x: -245, y: 245, z: 0}
|
||||
initFloat: 0
|
||||
|
|
@ -1660,7 +1660,7 @@ RectTransform:
|
|||
- {fileID: 3966076812878493885}
|
||||
- {fileID: 1278672238890784307}
|
||||
m_Father: {fileID: 7035216596183516586}
|
||||
m_RootOrder: 5
|
||||
m_RootOrder: 6
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0.5, y: 0.5}
|
||||
m_AnchorMax: {x: 0.5, y: 0.5}
|
||||
|
|
@ -2343,7 +2343,6 @@ MonoBehaviour:
|
|||
m_Script: {fileID: 11500000, guid: fcf53bbee510dca40b2f81e3c0d426c6, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
tweenSequeue1:
|
||||
tweenSequeue:
|
||||
- initV3: {x: 350, y: 0, z: 0}
|
||||
initFloat: 0
|
||||
|
|
@ -2709,7 +2708,7 @@ RectTransform:
|
|||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_Children: []
|
||||
m_Father: {fileID: 7035216596183516586}
|
||||
m_RootOrder: 7
|
||||
m_RootOrder: 8
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
m_AnchorMax: {x: 0, y: 0}
|
||||
|
|
@ -3636,7 +3635,6 @@ MonoBehaviour:
|
|||
m_Script: {fileID: 11500000, guid: fcf53bbee510dca40b2f81e3c0d426c6, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
tweenSequeue1:
|
||||
tweenSequeue:
|
||||
- initV3: {x: 0, y: -350, z: 0}
|
||||
initFloat: 0
|
||||
|
|
@ -3810,7 +3808,6 @@ MonoBehaviour:
|
|||
m_Script: {fileID: 11500000, guid: fcf53bbee510dca40b2f81e3c0d426c6, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
tweenSequeue1:
|
||||
tweenSequeue:
|
||||
- initV3: {x: -245, y: -245, z: 0}
|
||||
initFloat: 0
|
||||
|
|
@ -3874,7 +3871,7 @@ RectTransform:
|
|||
m_Children:
|
||||
- {fileID: 4657941056654120214}
|
||||
m_Father: {fileID: 7035216596183516586}
|
||||
m_RootOrder: 6
|
||||
m_RootOrder: 7
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0.5, y: 0.5}
|
||||
m_AnchorMax: {x: 0.5, y: 0.5}
|
||||
|
|
@ -4692,7 +4689,6 @@ MonoBehaviour:
|
|||
m_Script: {fileID: 11500000, guid: fcf53bbee510dca40b2f81e3c0d426c6, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
tweenSequeue1:
|
||||
tweenSequeue:
|
||||
- initV3: {x: 245, y: 245, z: 0}
|
||||
initFloat: 0
|
||||
|
|
@ -5038,6 +5034,102 @@ MonoBehaviour:
|
|||
m_FillClockwise: 1
|
||||
m_FillOrigin: 0
|
||||
m_UseSpriteMesh: 0
|
||||
--- !u!1 &4827149705743169771
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 8182329026388935402}
|
||||
- component: {fileID: 7226920074074924358}
|
||||
- component: {fileID: 7039179677341314769}
|
||||
- component: {fileID: 6661611105273371520}
|
||||
m_Layer: 5
|
||||
m_Name: maxTimes
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &8182329026388935402
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 4827149705743169771}
|
||||
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 100}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_Children: []
|
||||
m_Father: {fileID: 7035216596183516586}
|
||||
m_RootOrder: 2
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0.5, y: 0.5}
|
||||
m_AnchorMax: {x: 0.5, y: 0.5}
|
||||
m_AnchoredPosition: {x: 29.04, y: 619.2}
|
||||
m_SizeDelta: {x: 1080, y: 89.15}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!222 &7226920074074924358
|
||||
CanvasRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 4827149705743169771}
|
||||
m_CullTransparentMesh: 0
|
||||
--- !u!114 &7039179677341314769
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 4827149705743169771}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: ebfe0e44da74fbd44b1b744995de2324, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_Material: {fileID: 0}
|
||||
m_Color: {r: 0.42745098, g: 0.98039216, b: 0.33333334, a: 1}
|
||||
m_RaycastTarget: 0
|
||||
m_OnCullStateChanged:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI,
|
||||
Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
|
||||
m_FontData:
|
||||
m_Font: {fileID: 12800000, guid: 4b73e9e4512d17e4daeea351e090d33c, type: 3}
|
||||
m_FontSize: 30
|
||||
m_FontStyle: 0
|
||||
m_BestFit: 0
|
||||
m_MinSize: 3
|
||||
m_MaxSize: 40
|
||||
m_Alignment: 3
|
||||
m_AlignByGeometry: 0
|
||||
m_RichText: 1
|
||||
m_HorizontalOverflow: 0
|
||||
m_VerticalOverflow: 0
|
||||
m_LineSpacing: 1
|
||||
m_Text: "\u6D3B\u52A8\u5012\u8BA1\u65F6:3\u59295\u65F625\u5206"
|
||||
LanguageIndex: 10438
|
||||
--- !u!114 &6661611105273371520
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 4827149705743169771}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: -900027084, guid: f70555f144d8491a825f0804e09c671c, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_EffectColor: {r: 0, g: 0, b: 0, a: 0.5}
|
||||
m_EffectDistance: {x: 2, y: 2}
|
||||
m_UseGraphicAlpha: 1
|
||||
--- !u!1 &4882617500527515761
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
|
|
@ -5495,7 +5587,7 @@ RectTransform:
|
|||
- {fileID: 7361641814964839438}
|
||||
- {fileID: 7523844360500022796}
|
||||
m_Father: {fileID: 7035216596183516586}
|
||||
m_RootOrder: 3
|
||||
m_RootOrder: 4
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0.5, y: 0.5}
|
||||
m_AnchorMax: {x: 0.5, y: 0.5}
|
||||
|
|
@ -5532,7 +5624,7 @@ RectTransform:
|
|||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_Children: []
|
||||
m_Father: {fileID: 7035216596183516586}
|
||||
m_RootOrder: 8
|
||||
m_RootOrder: 9
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0.5, y: 0.5}
|
||||
m_AnchorMax: {x: 0.5, y: 0.5}
|
||||
|
|
@ -6075,7 +6167,6 @@ MonoBehaviour:
|
|||
m_Script: {fileID: 11500000, guid: fcf53bbee510dca40b2f81e3c0d426c6, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
tweenSequeue1:
|
||||
tweenSequeue:
|
||||
- initV3: {x: 0, y: 350, z: 0}
|
||||
initFloat: 0
|
||||
|
|
@ -6291,7 +6382,7 @@ RectTransform:
|
|||
- {fileID: 1811479771572553572}
|
||||
- {fileID: 2369111935633356843}
|
||||
m_Father: {fileID: 7035216596183516586}
|
||||
m_RootOrder: 4
|
||||
m_RootOrder: 5
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0.5, y: 0.5}
|
||||
m_AnchorMax: {x: 0.5, y: 0.5}
|
||||
|
|
@ -6356,7 +6447,6 @@ MonoBehaviour:
|
|||
m_Script: {fileID: 11500000, guid: fcf53bbee510dca40b2f81e3c0d426c6, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
tweenSequeue1:
|
||||
tweenSequeue:
|
||||
- initV3: {x: 245, y: -245, z: 0}
|
||||
initFloat: 0
|
||||
|
|
@ -7610,7 +7700,6 @@ MonoBehaviour:
|
|||
m_Script: {fileID: 11500000, guid: fcf53bbee510dca40b2f81e3c0d426c6, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
tweenSequeue1:
|
||||
tweenSequeue:
|
||||
- initV3: {x: -350, y: 0, z: 0}
|
||||
initFloat: 0
|
||||
|
|
|
|||
|
|
@ -26,6 +26,8 @@ this.thread=nil --协程
|
|||
|
||||
this.refreshTimer=nil
|
||||
this.upView = nil
|
||||
|
||||
local maxTimesCount = 0
|
||||
---初始化组件(用于子类重写)
|
||||
function LuckyTurnTablePanel:InitComponent(gameObject)
|
||||
LuckyTurnTableManager.InitTableData()
|
||||
|
|
@ -106,6 +108,7 @@ function LuckyTurnTablePanel:InitComponent(gameObject)
|
|||
|
||||
-- 奖励预览
|
||||
this.btnPreview = Util.GetGameObject(self.gameObject, "Panel/Top/btnPreview")
|
||||
this.maxTimes = Util.GetGameObject(self.gameObject, "Panel/maxTimes"):GetComponent("Text")
|
||||
end
|
||||
|
||||
---绑定事件(用于子类重写)
|
||||
|
|
@ -158,7 +161,8 @@ end
|
|||
|
||||
---界面打开时调用(用于子类重写)
|
||||
function LuckyTurnTablePanel:OnOpen(_TreasureType)
|
||||
LuckyTurnTableManager.curTreasureType =_TreasureType and _TreasureType or TreasureType.Lucky
|
||||
LuckyTurnTableManager.curTreasureType = _TreasureType and _TreasureType or TreasureType.Lucky
|
||||
maxTimesCount =tonumber(ConfigManager.GetConfigData(ConfigName.SpecialConfig,53).Value)
|
||||
end
|
||||
|
||||
---界面打开或者重新打开后,界面刷新时调用(用于子类重写)
|
||||
|
|
@ -242,6 +246,13 @@ function this.SwitchTreasureType(treasureType)
|
|||
this.ClearDefault()
|
||||
if treasureType==TreasureType.Lucky then
|
||||
LuckyTurnTableManager.curTreasureType=treasureType
|
||||
|
||||
if not PlayerPrefs.HasKey("treasure" .. treasureType) then
|
||||
PlayerPrefs.SetInt("treasure" .. treasureType, 0)
|
||||
end
|
||||
local tempnum = PlayerPrefs.GetInt("treasure" .. treasureType)
|
||||
this.maxTimes.text =string.format("单日最大探宝次数:%s/%s",tempnum,maxTimesCount)
|
||||
|
||||
this.upView:OnOpen({ showType = UpViewOpenType.ShowLeft, panelType = PanelType.LuckyTreasure })
|
||||
this.bg1.sprite=Util.LoadSprite(BgName[1])
|
||||
this.bg2.sprite=Util.LoadSprite(BgName[2])
|
||||
|
|
@ -276,22 +287,36 @@ function this.SwitchTreasureType(treasureType)
|
|||
end)
|
||||
--探宝1次按钮
|
||||
Util.AddOnceClick(this.treasureOnceBtn, function()
|
||||
if LuckyTurnTableManager.GetTreasureTicketNum(treasureType)-oneData[2]>=0 then
|
||||
if LuckyTurnTableManager.GetTreasureTicketNum(treasureType)-oneData[2]>=0
|
||||
and tempnum + 1 <= maxTimesCount then
|
||||
LuckyTurnTableManager.GetLuckyTurnRankRequest(TreasureType.Lucky,false,function()
|
||||
tempnum = tempnum + 1
|
||||
PlayerPrefs.SetInt("treasure" .. treasureType, tempnum)
|
||||
this.maxTimes.text =string.format("单日最大探宝次数:%s/%s",tempnum,maxTimesCount)
|
||||
--Log("==YSP== 幸运探宝返回的是什么"..tostring(LuckyTurnTableManager.luckyTempData.posInfos))
|
||||
this.SetTableTurnEffect(TableTurnType.Expedite,TreasureType.Lucky,LuckyTurnTableManager.luckyTempData.posInfos[1].pos)
|
||||
this.SetPropShow(60,TreasureType.Lucky)--更新消耗道具显示
|
||||
this.RrFreshInfo()
|
||||
|
||||
end)
|
||||
else
|
||||
--PopupTipPanel.ShowTip("幸运探宝券不足!")
|
||||
UIManager.OpenPanel(UIName.RewardItemSingleShowPopup,60,nil)
|
||||
if tempnum + 1 > maxTimesCount then
|
||||
PopupTipPanel.ShowTip("不可超出最大探宝次数!")
|
||||
return
|
||||
else
|
||||
UIManager.OpenPanel(UIName.RewardItemSingleShowPopup,60,nil)
|
||||
end
|
||||
end
|
||||
end)
|
||||
--探宝10次按钮
|
||||
Util.AddOnceClick(this.treasureMultipleBtn, function()
|
||||
if LuckyTurnTableManager.GetTreasureTicketNum(treasureType)-moreData[2]>=0 then
|
||||
if LuckyTurnTableManager.GetTreasureTicketNum(treasureType)-moreData[2]>=0
|
||||
and tempnum + 15 <= maxTimesCount then
|
||||
LuckyTurnTableManager.GetLuckyTurnRankRequest(TreasureType.Lucky,true,function()
|
||||
tempnum = tempnum + 15
|
||||
PlayerPrefs.SetInt("treasure" .. treasureType, tempnum)
|
||||
this.maxTimes.text =string.format("单日最大探宝次数:%s/%s",tempnum,maxTimesCount)
|
||||
--Log("==YSP== 幸运探宝返回的是什么"..tostring(LuckyTurnTableManager.luckyTempData))
|
||||
this.SetTableTurnEffect(TableTurnType.Expedite,TreasureType.Lucky,LuckyTurnTableManager.luckyTempData.posInfos[1].pos)
|
||||
this.SetPropShow(60,TreasureType.Lucky)--更新消耗道具显示
|
||||
|
|
@ -299,7 +324,12 @@ function this.SwitchTreasureType(treasureType)
|
|||
end)
|
||||
else
|
||||
--PopupTipPanel.ShowTip("幸运探宝券不足!")
|
||||
UIManager.OpenPanel(UIName.RewardItemSingleShowPopup,60,nil)
|
||||
if tempnum + 15 > maxTimesCount then
|
||||
PopupTipPanel.ShowTip("不可超出最大探宝次数!")
|
||||
return
|
||||
else
|
||||
UIManager.OpenPanel(UIName.RewardItemSingleShowPopup,60,nil)
|
||||
end
|
||||
end
|
||||
end)
|
||||
--刷新按钮
|
||||
|
|
@ -334,6 +364,13 @@ function this.SwitchTreasureType(treasureType)
|
|||
this.RrFreshInfo()
|
||||
elseif treasureType==TreasureType.Advanced then
|
||||
LuckyTurnTableManager.curTreasureType=treasureType
|
||||
|
||||
if not PlayerPrefs.HasKey("treasure" .. treasureType) then
|
||||
PlayerPrefs.SetInt("treasure" .. treasureType, 0)
|
||||
end
|
||||
local tempnum = PlayerPrefs.GetInt("treasure" .. treasureType)
|
||||
this.maxTimes.text =string.format("单日最大探宝次数:%s/%s",tempnum,maxTimesCount)
|
||||
|
||||
this.upView:OnOpen({ showType = UpViewOpenType.ShowLeft, panelType = PanelType.AdvancedTreasure })
|
||||
this.bg1.sprite=Util.LoadSprite(BgName[3])
|
||||
this.bg2.sprite=Util.LoadSprite(BgName[4])
|
||||
|
|
@ -369,8 +406,12 @@ function this.SwitchTreasureType(treasureType)
|
|||
end)
|
||||
--探宝1次按钮
|
||||
Util.AddOnceClick(this.treasureOnceBtn, function()
|
||||
if LuckyTurnTableManager.GetTreasureTicketNum(treasureType)-oneData[2]>=0 then
|
||||
if LuckyTurnTableManager.GetTreasureTicketNum(treasureType)-oneData[2]>=0
|
||||
and tempnum + 1 <= maxTimesCount then
|
||||
LuckyTurnTableManager.GetLuckyTurnRankRequest(TreasureType.Advanced,false,function()
|
||||
tempnum = tempnum + 1
|
||||
PlayerPrefs.SetInt("treasure" .. treasureType, tempnum)
|
||||
this.maxTimes.text =string.format("单日最大探宝次数:%s/%s",tempnum,maxTimesCount)
|
||||
--Log("==YSP== 高级探宝返回的是什么"..tostring(LuckyTurnTableManager.advancedTempData))
|
||||
this.SetTableTurnEffect(TableTurnType.Expedite,TreasureType.Advanced,LuckyTurnTableManager.advancedTempData.posInfos[1].pos)
|
||||
this.SetPropShow(61,TreasureType.Advanced)
|
||||
|
|
@ -378,13 +419,22 @@ function this.SwitchTreasureType(treasureType)
|
|||
end)
|
||||
else
|
||||
--PopupTipPanel.ShowTip("高级探宝券不足!")
|
||||
UIManager.OpenPanel(UIName.RewardItemSingleShowPopup,61,nil)
|
||||
if tempnum + 1 > maxTimesCount then
|
||||
PopupTipPanel.ShowTip("不可超出最大探宝次数!")
|
||||
return
|
||||
else
|
||||
UIManager.OpenPanel(UIName.RewardItemSingleShowPopup,61,nil)
|
||||
end
|
||||
end
|
||||
end)
|
||||
--探宝10次按钮
|
||||
Util.AddOnceClick(this.treasureMultipleBtn, function()
|
||||
if LuckyTurnTableManager.GetTreasureTicketNum(treasureType)-moreData[2]>=0 then
|
||||
if LuckyTurnTableManager.GetTreasureTicketNum(treasureType)-moreData[2]>=0
|
||||
and tempnum + 10 <= maxTimesCount then
|
||||
LuckyTurnTableManager.GetLuckyTurnRankRequest(TreasureType.Advanced,true,function()
|
||||
tempnum = tempnum + 10
|
||||
PlayerPrefs.SetInt("treasure" .. treasureType, tempnum)
|
||||
this.maxTimes.text =string.format("单日最大探宝次数:%s/%s",tempnum,maxTimesCount)
|
||||
--Log("==YSP== 高级探宝返回的是什么"..tostring(LuckyTurnTableManager.advancedTempData))
|
||||
this.SetTableTurnEffect(TableTurnType.Expedite,TreasureType.Advanced,LuckyTurnTableManager.advancedTempData.posInfos[1].pos)
|
||||
this.SetPropShow(61,TreasureType.Advanced)
|
||||
|
|
@ -392,7 +442,12 @@ function this.SwitchTreasureType(treasureType)
|
|||
end)
|
||||
else
|
||||
--PopupTipPanel.ShowTip("高级探宝券不足!")
|
||||
UIManager.OpenPanel(UIName.RewardItemSingleShowPopup,61,nil)
|
||||
if tempnum + 10 > maxTimesCount then
|
||||
PopupTipPanel.ShowTip("不可超出最大探宝次数!")
|
||||
return
|
||||
else
|
||||
UIManager.OpenPanel(UIName.RewardItemSingleShowPopup,61,nil)
|
||||
end
|
||||
end
|
||||
end)
|
||||
--刷新按钮
|
||||
|
|
|
|||
Loading…
Reference in New Issue