1
0
Fork 0
mirror of https://github.com/Reuh/ubiquitousse.git synced 2025-10-27 17:19:31 +00:00

Probably works better this way

This commit is contained in:
Reuh 2017-04-05 21:01:42 +02:00
parent b2d22c75d1
commit e063f55514
4 changed files with 44 additions and 23 deletions

View file

@ -1,5 +1,6 @@
-- ubiquitousse.scene
local uqt = require((...):match("^(.-ubiquitousse)%."))
local m = uqt.module
local time = uqt.time
--- Returns the file path of the given module name.
@ -52,7 +53,7 @@ scene = {
return {
name = name or "unamed", -- The scene name.
time = time and time.new(), -- Scene-specific TimerRegistry, if uqt.time is enabled.
time = m.time and time.new(), -- Scene-specific TimerRegistry, if uqt.time is enabled.
enter = function(self, ...) end, -- Called when entering a scene.
exit = function(self) end, -- Called when exiting a scene, and not expecting to come back (scene may be unloaded).
@ -116,7 +117,7 @@ scene = {
-- @impl ubiquitousse
update = function(dt, ...)
if scene.current then
if time then scene.current.time.update(dt) end
if m.time then scene.current.time.update(dt) end
scene.current:update(dt, ...)
end
end,