PGRData/Script/matrix/xentity/xguilddorm/furniture/events/XGDFTestEvent.lua

24 lines
643 B
Lua
Raw Permalink Normal View History

local XGDFBaseEvent = require("XEntity/XGuildDorm/Furniture/Events/XGDFBaseEvent")
2024-09-01 20:49:41 +00:00
---@class XGDFTestEvent : XGDFBaseEvent
local XGDFTestEvent = XClass(XGDFBaseEvent, "XGDFTestEvent")
function XGDFTestEvent:Init()
self:StartEntryBtnListener()
end
function XGDFTestEvent:CheckOnce()
self:Trigger(XTime.GetServerNowTimestamp() % 2 == 0)
end
function XGDFTestEvent:StartEntryBtnListener()
self.EntryBtnTimeId = XScheduleManager.ScheduleForever(
function()
self:CheckOnce()
end,5000
)
end
function XGDFTestEvent:Dispose()
XScheduleManager.UnSchedule(self.EntryBtnTimeId)
end
return XGDFTestEvent