miduo_client/Assets/ManagedResources/~Lua/Modules/Guild/RedPacketView/GuildRedPacketManager.lua

83 lines
2.4 KiB
Lua
Raw Normal View History

2021-04-20 13:58:00 +08:00
GuildRedPacketManager = {}
2020-05-09 13:31:21 +08:00
local this = GuildRedPacketManager
-- 默认未检查公会红包
this.isCheck=false
function this.Initialize()
end
-- 检查公会红包红点
function this.CheckGuildRedPacketRedPoint()
-- Log("<color=yellow>"..tostring(this.isCheck).."</color>")
2021-05-21 14:47:04 +08:00
-- if this.isCheck then
-- return this.isCheck
-- else
-- return false
-- end
local list=MyGuildManager.GetMyGuidRedPackage()
LogError("检测发红包红点111")
if list and LengthOfTable(list)>0 then
LogError("检测发红包红点")
2021-05-21 14:47:04 +08:00
for key, value in pairs(list) do
2021-05-25 14:52:02 +08:00
if value and value.num and value.num>0 then
LogError("444444444444")
2021-05-21 14:47:04 +08:00
return true
end
end
end
LogError("5555555555")
2021-05-21 14:47:04 +08:00
return false
end
function this.CheckIsCanGetPackage()
-- NetManager.GetAllRedPacketResponse(function(msg)
-- -- local data={}
-- -- for i,v in ipairs(msg.info) do
-- -- table.insert(data,v)
-- -- end
-- local dataLength=#msg.info
-- LogError("+++++++++++++++ "..dataLength )
-- if dataLength>0 then
-- return true
-- end
-- return false
-- end)
LogError("现在红包得数量:"..MyGuildManager.GetRedPackageNum())
if MyGuildManager.GetRedPackageNum()>0 then
--Game.GlobalEvent:DispatchEvent(GameEvent.Chat.OnRedPackageNumChanged,true)
local aaa=Util.GetGameObject(UIManager.uiNode,"GuildMainCityPanel/ChatTipView/Image")
local bbb=Util.GetGameObject(UIManager.uiNode,"MainPanel/ChatTipView/Image")
if aaa then
LogError("显示红包")
aaa.gameObject:SetActive(true)
end
if bbb then
LogError("显示红包")
bbb.gameObject:SetActive(true)
end
2021-05-21 14:47:04 +08:00
return true
2020-05-09 13:31:21 +08:00
else
-- Game.GlobalEvent:DispatchEvent(GameEvent.Chat.OnRedPackageNumChanged,false)
local aaa=Util.GetGameObject(UIManager.uiNode,"GuildMainCityPanel/ChatTipView/Image")
local bbb=Util.GetGameObject(UIManager.uiNode,"MainPanel/ChatTipView/Image")
if aaa then
LogError("不显示红包")
aaa.gameObject:SetActive(false)
end
if bbb then
LogError("bu显示红包")
bbb.gameObject:SetActive(false)
end
2020-05-09 13:31:21 +08:00
return false
end
return false
2020-05-09 13:31:21 +08:00
end
2021-05-21 14:47:04 +08:00
2020-06-23 18:36:24 +08:00
return this