summaryrefslogtreecommitdiff
path: root/scene/main/scene_main_loop.h
diff options
context:
space:
mode:
Diffstat (limited to 'scene/main/scene_main_loop.h')
-rw-r--r--scene/main/scene_main_loop.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/scene/main/scene_main_loop.h b/scene/main/scene_main_loop.h
index 38d13c0447..6129a12446 100644
--- a/scene/main/scene_main_loop.h
+++ b/scene/main/scene_main_loop.h
@@ -47,6 +47,22 @@ class Viewport;
class Material;
class Mesh;
+
+
+class SceneTreeTimer : public Reference {
+ OBJ_TYPE(SceneTreeTimer,Reference);
+
+ float time_left;
+protected:
+ static void _bind_methods();
+public:
+
+ void set_time_left(float p_time);
+ float get_time_left() const;
+
+ SceneTreeTimer();
+};
+
class SceneTree : public MainLoop {
_THREAD_SAFE_CLASS_
@@ -155,6 +171,8 @@ private:
void _change_scene(Node* p_to);
//void _call_group(uint32_t p_call_flags,const StringName& p_group,const StringName& p_function,const Variant& p_arg1,const Variant& p_arg2);
+ List<Ref<SceneTreeTimer> > timers;
+
static SceneTree *singleton;
friend class Node;
@@ -339,6 +357,8 @@ public:
Error change_scene_to(const Ref<PackedScene>& p_scene);
Error reload_current_scene();
+ Ref<SceneTreeTimer> create_timer(float p_delay_sec);
+
//used by Main::start, don't use otherwise
void add_current_scene(Node * p_current);