local timer -- ./ecs/commonsystems/timer.can:4 timer = require((...):match("^(.-)ecs%.timer") .. "scene") -- ./ecs/commonsystems/timer.can:4 return { -- ./ecs/commonsystems/timer.can:6 ["name"] = "timer", -- ./ecs/commonsystems/timer.can:7 ["filter"] = "timer", -- ./ecs/commonsystems/timer.can:8 ["default"] = {}, -- ./ecs/commonsystems/timer.can:9 ["process"] = function(self, e, t, dt) -- ./ecs/commonsystems/timer.can:12 t:update(dt) -- ./ecs/commonsystems/timer.can:13 if t:dead() then -- ./ecs/commonsystems/timer.can:14 self["world"]:remove(t["entity"]) -- ./ecs/commonsystems/timer.can:15 end -- ./ecs/commonsystems/timer.can:15 end, -- ./ecs/commonsystems/timer.can:15 ["run"] = function(self, func) -- ./ecs/commonsystems/timer.can:20 local t = timer["run"](func) -- ./ecs/commonsystems/timer.can:21 self["world"]:add({ ["timer"] = t }) -- ./ecs/commonsystems/timer.can:23 return t -- ./ecs/commonsystems/timer.can:25 end, -- ./ecs/commonsystems/timer.can:25 ["tween"] = function(self, duration, tbl, to, method) -- ./ecs/commonsystems/timer.can:28 local t = timer["tween"](duration, tbl, to, method) -- ./ecs/commonsystems/timer.can:29 self["world"]:add({ ["timer"] = t }) -- ./ecs/commonsystems/timer.can:31 return t -- ./ecs/commonsystems/timer.can:33 end -- ./ecs/commonsystems/timer.can:33 } -- ./ecs/commonsystems/timer.can:33