From e2f8df8c5b3b6a1d4c18a75ff1c8293cc5909bc0 Mon Sep 17 00:00:00 2001 From: reduz Date: Tue, 24 Aug 2021 19:03:10 -0300 Subject: Add ability to register singletons from engine API * Exposed functions in Engine to register and unregister singletons. * Added the concept of user singletons, which can be removed (the system ones can't). --- core/core_bind.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'core/core_bind.h') diff --git a/core/core_bind.h b/core/core_bind.h index 1dbe49f418..a6fac63edd 100644 --- a/core/core_bind.h +++ b/core/core_bind.h @@ -639,8 +639,11 @@ public: bool is_in_physics_frame() const; - bool has_singleton(const String &p_name) const; - Object *get_singleton_object(const String &p_name) const; + bool has_singleton(const StringName &p_name) const; + Object *get_singleton_object(const StringName &p_name) const; + void register_singleton(const StringName &p_name, Object *p_object); + void unregister_singleton(const StringName &p_name); + Vector get_singleton_list() const; void set_editor_hint(bool p_enabled); bool is_editor_hint() const; -- cgit v1.2.3