PGRData/Script/matrix/xui/xuireviewactivity/components/XUiReviewActivityGridCollection.lua
2024-09-01 22:49:41 +02:00

29 lines
No EOL
1.1 KiB
Lua
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

local XUiReviewActivityGridCollection = XClass(nil, "XUiReviewActivityGridCollection")
function XUiReviewActivityGridCollection:Ctor(ui)
XTool.InitUiObjectByUi(self, ui)
end
function XUiReviewActivityGridCollection:RefreshData(id)
self.Id = id
local data = XDataCenter.MedalManager.GetScoreTitleById(id)
if data.MedalImg ~= nil then
self.ImgCollectionIcon:SetRawImage(data.MedalImg)
end
self.TxtCollectionName.text = data.Name
end
function XUiReviewActivityGridCollection:PlayEnableAnime(index) --该index是当前使用的grid中的序号不是总grid里的动态列表组件上的属性的index,etc:共10个gird若只显示最后5个且该格子是第10个的话参数Index就是5
self.GameObject:SetActive(false)
XScheduleManager.ScheduleOnce(function()
if not XTool.UObjIsNil(self.Transform) then
self.GameObject:SetActive(true)
self.Transform:Find("Animation/GridMedalEnable"):PlayTimelineAnimation(function ()
end)
end
end, (index) * 95)
end
return XUiReviewActivityGridCollection