【牛气冲天】红点bug提交

(cherry picked from commit af8f9e0f409980ed6c85b205cb2c0503b4c9e301)
dev_chengFeng
ZhangBiao 2021-03-25 16:05:57 +08:00
parent 3b99759f6f
commit b7c51cbf48
1 changed files with 13 additions and 7 deletions

View File

@ -13,9 +13,9 @@ local curPage = 1
local redPointList = {}
local TabBox = require("Modules/Common/TabBox")
local _TabData={ [1] = { default = "r_hero_xuanze_002", select = "r_hero_xuanze_001", name = "诸神" },
[2] = { default = "r_hero_xuanze_002", select = "r_hero_xuanze_001", name = "地煞" },
[3] = { default = "r_hero_xuanze_002", select = "r_hero_xuanze_001", name = "天罡" },}
local _TabData={ [1] = { default = "r_hero_xuanze_002", select = "r_hero_xuanze_001", name = "诸神" ,rpType = RedPointType.NiuQiChongTian_1},
[2] = { default = "r_hero_xuanze_002", select = "r_hero_xuanze_001", name = "地煞" ,rpType = RedPointType.NiuQiChongTian_2},
[3] = { default = "r_hero_xuanze_002", select = "r_hero_xuanze_001", name = "天罡" ,rpType = RedPointType.NiuQiChongTian_3},}
local _TabFontColor = { default = Color.New(130 / 255, 128 / 255, 120 / 255, 1),
select = Color.New(243 / 255, 235 / 255, 202 / 255, 1)}
local curIndex = 1
@ -86,8 +86,14 @@ end
-- tab节点显示自定义
function this.TabAdapter(tab, index, status)
local tabLab = Util.GetGameObject(tab, "Text")
redPointList[index] = Util.GetGameObject(tab, "Redpot")
BindRedPointObject(RedPointType.NiuQiChongTian + index,redPointList[index])
local redPoint = Util.GetGameObject(tab, "Redpot")
if _TabData[index].rpType > 0 then
if redPointList[_TabData[index].rpType] then
ClearRedPointObject(_TabData[index].rpType, redPointList[_TabData[index].rpType])
end
BindRedPointObject(_TabData[index].rpType,redPoint)
redPointList[_TabData[index].rpType] = redPoint
end
Util.GetGameObject(tab,"Image"):GetComponent("Image").sprite = Util.LoadSprite(_TabData[index][status])
tabLab:GetComponent("Text").text = _TabData[index].name
tabLab:GetComponent("Text").color = _TabFontColor[status]
@ -199,8 +205,8 @@ end
--界面关闭时调用(用于子类重写)
function NiuQiChongTian:OnClose()
for i = 1, 3 do
ClearRedPointObject(RedPointType.NiuQiChongTian + i, redPointList[i])
for key, value in pairs(redPointList) do
ClearRedPointObject(key, value)
end
redPointList = {}
end