PGRData/Script/matrix/xentity/xguilddorm/components/XGDComponet.lua

44 lines
No EOL
937 B
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 XGDComponet = XClass(nil, "XGDComponet")
function XGDComponet:Ctor()
self._isInit = false
self._UpdatedTime = 0
self._UpdateIntervalTime = 0
end
function XGDComponet:Init()
if self._isInit then return end
self._isInit = true
end
function XGDComponet:GetIsInit()
return self._isInit
end
function XGDComponet:SetUpdateIntervalTime(value)
self._UpdateIntervalTime = value
end
function XGDComponet:CheckCanUpdate(dt)
if self._UpdateIntervalTime <= 0 then
return true
end
self._UpdatedTime = self._UpdatedTime + dt
if self._UpdatedTime >= self._UpdateIntervalTime then
self._UpdatedTime = 0
return true
end
return false
end
-- -- 每帧运行
-- function XGDComponet:Update(deltaTime)
-- end
-- 和role相关的依赖放在这里执行每当update roleId时会调用
-- function XGDComponet:UpdateRoleDependence()
-- end
return XGDComponet