Scene: Add time
as the amount of seconds it has been enabled.
This commit is contained in:
parent
0d2d2a2d44
commit
a2024c4ebc
2 changed files with 2 additions and 0 deletions
|
@ -188,6 +188,7 @@ proc myou_main_loop*(self: MyouEngine) =
|
||||||
for _,scene in self.scenes.pairs:
|
for _,scene in self.scenes.pairs:
|
||||||
if not scene.enabled:
|
if not scene.enabled:
|
||||||
continue
|
continue
|
||||||
|
scene.time += delta_seconds
|
||||||
for f in scene.pre_draw_callbacks:
|
for f in scene.pre_draw_callbacks:
|
||||||
f(scene, delta_seconds)
|
f(scene, delta_seconds)
|
||||||
self.renderer.draw_all()
|
self.renderer.draw_all()
|
||||||
|
|
|
@ -373,6 +373,7 @@ type
|
||||||
active_camera*: Camera
|
active_camera*: Camera
|
||||||
physics_enabled*: bool
|
physics_enabled*: bool
|
||||||
world*: World
|
world*: World
|
||||||
|
time*: float
|
||||||
|
|
||||||
# render options
|
# render options
|
||||||
background_color*: Vec4
|
background_color*: Vec4
|
||||||
|
|
Loading…
Reference in a new issue