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

83 lines
2.4 KiB
Lua

GuildRedPacketManager = {}
local this = GuildRedPacketManager
-- 默认未检查公会红包
this.isCheck=false
function this.Initialize()
end
-- 检查公会红包红点
function this.CheckGuildRedPacketRedPoint()
-- Log("<color=yellow>"..tostring(this.isCheck).."</color>")
-- 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("检测发红包红点")
for key, value in pairs(list) do
if value and value.num and value.num>0 then
LogError("444444444444")
return true
end
end
end
LogError("5555555555")
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
return true
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
return false
end
return false
end
return this