From 12e0a2d0bb8cc2bdb11b50729d0ad2d33790a46a Mon Sep 17 00:00:00 2001 From: jiaoyangna <3046463818@qq.com> Date: Fri, 18 Jun 2021 15:53:42 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8B=8D=E8=84=B8=E4=BF=AE=E6=94=B9=E6=8F=90?= =?UTF-8?q?=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../~Lua/Modules/Expert/PatFaceManager.lua | 34 +++++++++++++++---- 1 file changed, 27 insertions(+), 7 deletions(-) diff --git a/Assets/ManagedResources/~Lua/Modules/Expert/PatFaceManager.lua b/Assets/ManagedResources/~Lua/Modules/Expert/PatFaceManager.lua index a6c4c09bb6..9fcead2c9c 100644 --- a/Assets/ManagedResources/~Lua/Modules/Expert/PatFaceManager.lua +++ b/Assets/ManagedResources/~Lua/Modules/Expert/PatFaceManager.lua @@ -388,16 +388,36 @@ function this.SetPatFaceDaqta(PatFaceDatas) --LogYellow("后端推送礼包拍脸 拍脸ID "..curRechargeCommodityConfig.PosterUiId) local config = ConfigManager.GetConfigData(ConfigName.LoginPosterConfig,curRechargeCommodityConfig.PosterUiId) local isShow = true - for k,v in ipairs(this.backPatFaceAllData) do - if config.Type == v.Type then - isShow = false - break + if config.Type == FacePanelType.Surprise then + if not PlayerPrefs.HasKey(PlayerManager.uid.."Surprise") then + PlayerPrefs.SetString(PlayerManager.uid.."Surprise","0#0") end - end + local str = PlayerPrefs.GetString(PlayerManager.uid.."Surprise") + str = string.split(str,"#") + local curTimeStemp = math.floor(GetTimeStamp() / (24 * 3600)) + local times = str[2] + if str[1] ~= curTimeStemp then + times = 0 + PlayerPrefs.SetString(PlayerManager.uid.."Surprise",curTimeStemp.."#"..times) + end + if times >= 2 then + isShow = false + else + for k,v in ipairs(this.backPatFaceAllData) do + if config.Type == v.Type then + isShow = false + break + end + end + if isShow then + times = times + 1 + PlayerPrefs.SetString(PlayerManager.uid.."Surprise",str[1].."#"..times) + end + end + end if isShow then table.insert(this.backPatFaceAllData,config) - end - + end end end end