mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-14 07:21:51 +00:00
add schedule:set_timeout
This commit is contained in:
parent
763b3d5aa4
commit
ac8e5f1bd1
1 changed files with 3 additions and 0 deletions
|
|
@ -11,6 +11,9 @@ local Schedule = {
|
||||||
self._next_interval = id + 1
|
self._next_interval = id + 1
|
||||||
return id
|
return id
|
||||||
end,
|
end,
|
||||||
|
set_timeout = function(self, ms, callback)
|
||||||
|
self:set_interval(ms, callback, 1)
|
||||||
|
end,
|
||||||
tick = function(self, dt)
|
tick = function(self, dt)
|
||||||
local timer = self._timer + dt
|
local timer = self._timer + dt
|
||||||
for id, interval in pairs(self._intervals) do
|
for id, interval in pairs(self._intervals) do
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue